Prefixing global areas

Permalink Browser Info Environment
I've just installed Multiple Domains on a running site and realized I have to prefix the global areas as described in the docs.

Upon updating the code all content of the areas will disappear (since they now refer to a new empty prefixed global area) and content has to be brought in again.

Is there a way to do this via the database? Could I simply run an update query to "moove" the content from the old global areas to the new prefixed ones?

Type: Discussion
Status: Resolved
busters
View Replies:
Mainio replied on at Permalink Reply
Mainio
Hi,

You sure can do this via database, like basically anything related to the data of your site.

First of all, before following any of my advice below, MAKE SURE TO TAKE A DATABASE DUMP BEFORE EVERY TIME YOU TOUCH IT BY HAND! And I really mean to shout that, I very rarely use caps to emphasize myself.

But what I would suggest to instead is just to change the global area names if you want to just move the content from one global area to another. To do this:
- First, go to the section of the site where you want the target global areas to appear. See what prefix it uses and remember that for later us.
- Remove all the empty global areas you don't need. You can do this straight through the concrete5 UI, from the "Stacks" section
- If you're running the latest version, go through to each of the Global Areas that have content and rename them. You can do this by clicking the "Rename" button when you're editing the Global Area through the "Stacks" section of the website.

If you're not running the latest version, you can still update the names to the database with the following SQL command:
UPDATE Stacks SET stName = 'Your New Name' WHERE stName = 'Your Old Name';


If you want to duplicate the global areas, i.e. start another domain's Global Area with the content from other domain, you can also do this straight from the UI if you're running the latest version of concrete5. Just go to the dashboard's Stacks section, go under the Global Area to be duplicated and then click the "Duplicate Stack" button.

Give the new area the name prefix of your other domain. If you don't know it, you can see it if you go to the "Manage" view under multiple domains, click the "Edit" button of the target domain and take a look at the URL of your browser. The last number in the URL tells you the domain's ID number you need to use as the prefix.

Hoping this will help you out!

Best,
Antti / Mainio

concrete5 Environment Information

# concrete5 Version
5.6.3.1

# concrete5 Packages
Advanced Forms (1.11.1), Extended Google Map (3.2), Image Slider (1.1), Internationalization (1.3), List files from set (1.0.4), Login (1.1.1), Multiple Domains (1.4.3), Pro Events (10.1.0), Pro News (5.0.2), Sortable Fancybox Gallery (1.17).

# concrete5 Overrides
blocks/sixeightforms, blocks/image, blocks/pronews_list, blocks/autonav, blocks/sortable_fancybox_gallery, blocks/content, blocks/login, blocks/pro_event_list, blocks/extended_google_map, blocks/list_files_from_set, blocks/image_slider, languages/es_ES, languages/sv_SE, languages/de_DE, languages/ru_RU, languages/fr_FR, languages/zh_CN, libraries/request.php, themes/leonlurjetrophy, themes/ljusavdelningen, themes/goldendays, themes/hannaherngren, themes/leonlurjetrophy_new, themes/standardherrklader, themes/uniteit, themes/bakdelen, themes/gotsprings, themes/demotheme, themes/alignment_academy, themes/p3firsttheme, themes/caroliner, themes/amhult2, themes/ProWeb, themes/automekano, themes/decobags

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - Off

# Server Software
Apache

# Server API
apache2handler

# PHP Version
5.4.34-0+deb7u1

# PHP Extensions
apache2handler, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, json, libxml, mbstring, mhash, mysql, mysqli, openssl, pcre, PDO, pdo_mysql, Phar, posix, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, zip, zlib.

# PHP Settings
max_execution_time - 120
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 256M
post_max_size - 100M
sql.safe_mode - Off
upload_max_filesize - 100M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:33.0) Gecko/20100101 Firefox/33.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.