Steps to delete a wiki[edit | edit source]
- Add the database to /srv/mediawiki/dblist/deleted.dblist,
- run php /srv/mediawiki/w/extensions/MirahezeMagic/maintenance/removeDeletedWikis.php --wiki metawiki,
- DELETE from cw_wikis WHERE wiki_dbname = '<wiki>';,
- and have a DBA drop the databse
Steps to rename a wiki[edit | edit source]
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.
- One should create a complete SQL dump of the wiki to be renamed.
- there are probably multiple ways of doing this, but I used "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.
- Create an empty database for the new wiki.
- I did this by using "sudo -i mysql" to open an interactive prompt, followed by "create database nameofnewwikidb" replacing nameofnewwikidb with the target subdomain + wiki.
- Import the SQL dump into the new database.
- Again, probably a few ways to do this, I used "sudo -i mysql" followed by "use nameofnewwikidb" followed by "source /path/to/dump.sql;" replacing the wiki name, path, and file name as appropriate, but including the ; at the end of the command
- After the new wiki is created, run
sudo -u www-data php /srv/mediawiki/w/extensions/CreateWiki/maintenance/renameWiki.php --wiki=loginwiki --rename nameofwikidb nameofnewwikidb <user_running_script>
- Finally, AFTER YOU ARE VERY CERTAIN ALL OF THE ABOVE WAS DONE CORRECTLY, you may drop the old database.
DROP DATABASE nameofwikidb
After rename[edit source]
- If there is any configuration on LocalSettings.php change the DB name there as well