Title here
Summary here
One should be careful renaming a wiki (database/domain) as it involves many steps and basically anything going wrong can make it impossible for users to login across the entire farm, or worse.
Following directions found here, I will update to clarify a little.
Note: The wiki should probably be made read-only before doing any of this, remember to make it readable after.
sudo -i mysqldump nameofwikidb > nameofwikidb.sql
in my home directory, replacing “nameofwikidb” to be the name of the database, including the final “wiki”. Note that this (if run in your home directory) creates the SQL dump in your home directory.sudo -i mysql -e "CREATE DATABASE nameofnewwikidb;"
replacing “nameofnewwikidb” with the target subdomain + wiki.sudo -i mysql -D nameofnewwikidb -e "SOURCE /path/to/dump.sql;"
replacing the wiki name, path, and file name as appropriate, but including the ;
at the end of the command.sudo -u www-data php /srv/mediawiki/w/extensions/CreateWiki/maintenance/renameWiki.php --wiki=loginwiki --rename nameofwikidb nameofnewwikidb <user_running_script>
sudo -i mysql -e "DROP DATABASE nameofwikidb;"
Double check Swift:
. /etc/swift-env.sh
swift list --prefix miraheze-<old_wiki_db>
If anything shows in the above, for each of them:diff --color <(swift list miraheze-<new_wiki_db>-<zone>) <(swift list miraheze-<old_wiki_db>-<zone>)
local-public
If only empty directories or everything looks fine there (files returned by that are now only present on old container, not on the new wiki container), you can remove the old containers with:swift delete miraheze-<old_wiki_db>-<zone>
sudo -u www-data rm -rf /tmp/miraheze-<old_wiki_db>-<zone>
Finally, run:
sudo -u www-data php /srv/mediawiki/w/extensions/CreateWiki/maintenance/setContainersAccess.php --wiki=<new_wiki_db>