Tech:Rename a wiki

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.
 * 1) One should create a complete SQL dump of the wiki to be renamed.
 * 2) * 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.
 * 3) Create an empty database for the new wiki.
 * 4) * 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.
 * 5) Import the SQL dump into the new database.
 * 6) * 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
 * 7) After the new wiki is created, one must update cw_wikis table and the central_auth db. Run all of the following commands before dropping the old database:
 * 8) Rename the wiki in cw_wikis
 * 9) Use metawiki (either via db1 mysql prompt or sql.php --wiki metawiki)
 * 10) UPDATE cw_wikis SET wiki_dbname="newwiki" WHERE wiki_dbname="oldwiki";
 * 11) * Be very careful to replace newwiki and oldwiki as needed.
 * 12) Rename the wiki in centralauth.localuser and centralauth.localnames
 * 13) use centralauth (must be connected via db1 for this)
 * 14) UPDATE localuser SET lu_wiki="newwiki" WHERE lu_wiki="oldwiki";
 * 15) UPDATE localnames SET ln_wiki="newwiki" WHERE ln_wiki="oldwiki";
 * 16) * Again, BE VERY CAREFUL to replace newwiki and oldwiki as needed.
 * 17) Finally, AFTER YOU ARE VERY CERTAIN ALL OF THE ABOVE WAS DONE CORRECTLY, you may drop the old database.