Rename a wiki database

From Wikitech

This document describes a possible approach to renaming a wiki.

This is a Request for comments and has not been reviewed yet.

Assumptions

  • The language code of a wiki shall be renamed. The wiki keeps its "class" (e.g. wikipedia, wikiversity, etc).
  • The languagecodes "old" and "new" will be used to name the old and new wikis. "newwiki" and "oldwiki" are the names of the new and old databases.

Approach

  1. Add the new language code and the language name to languages/Names.php
  2. Create messages/MessagesNew.php and, if necessary, classes/LanguageNew.php
  3. Add the language code to /home/wikipedia/common/langlist
  4. Set oldwiki to read-only
  5. Create a mysql dump of the database oldwiki
  6. Create a mysql dump of the extstores. Very old wikis will have text records stored in different extstores!
  7. php maintenance/addwiki.php --wiki=oldwiki new newwiki newwiki new.wikipedia.org
  8. Set newwiki to read-only
  9. Import the database dump of the old wiki into the new database.
  10. Import the extstore dump into the new exstore database.
  11. Change all settings in InitialiseSettings.php and, if necessary, in flaggedrevs.php etc pp
  12. Move the images from /mnt/upload6/project/old to /mnt/upload6/project/new and from /mnt/thumbs/project/old to /mnt/thumbs/project/new
  13. ??? Do we have to do any changes for SUL?
  14. Update the interwiki cache: php maintenance/dumpInterwiki.php -o cache/interwiki.cdb
  15. sync-common-all
  16. Add the new wiki in the DNS zone
  17. Set newwiki to read-write
  18. Set up redirects from old.project.org to new.project.org in /home/wikipedia/conf/redirects.conf
  19. If no other wikis with language code old exist, remove old from /home/wikipedia/common/langlist
  20. Remove oldwiki from all *.dblist files

open topics

  1. update Lucene search system
  2. clean page caches for all projects since the interwiki is incorrect in Squid caches (redirection can handle it though)
  3. need a script to verify the configuration before and after (compare $_GLOBALS ? ), or use if( $wgDbName == 'oldwiki' || $wgDbName == 'newiki' )
  4. synchronize the operation with toolserver. We might want them to do the same operation.
  5. make sure search engines handle the redirection correctly (they should forget about the old page maybe 301 Moved Permanently).
  6. this procedure should be fully tested
  7. write a backup plan so we can easily apply it if anything goes wrong.
  8. optionally clear memcached obsoletes keys