Tech:Moving a wiki to another database server

In the case that you need to move a wiki to another database server (usually related to disk space issues/unbalances) this guide will guide you. Moving a wiki to another database is not very complicated if you have the required rights (SRE, root on db4/db5 mostly) and follow the process below.

1 Put the wiki which you are moving in read-only mode (add a read-only notice if you want (especially if it is a large wiki and it will take time): https://github.com/miraheze/mw-config/commit/497e5608d95ba148b81133d5c34ce72a046d9c43)

2. Connect to the server on which the database is located and as root execute either  or   (replacing nameofwiki with the name of the wiki you want to move)

3. Then, execute either  (Only do this if you did not already ssh this over)

4. Open the target server and unzip the file,

5.

6.

7. Change wiki_dbcluster in metawiki.cw_wikis

8. Change the cluster in Database.php: https://github.com/miraheze/mw-config/compare/5545e4d8b629...d6954ed7d75d

9. Remove read-only mode from the wiki.

10. After  you have made sure  that the wiki works on the new database server and that it has been imported correctly, you can drop the database on the initial server.