Manual:Moving a wiki/en

This page explains how to move a wiki to another server. This is often needed when moving to a different web server or domain (or both).

The safest way to do it is by using the same MediaWiki version on both wikis. However, it's possible to install newer MediaWiki version on the new server and perform an upgrade directly on the new server. In fact, this may be your only option if you want to upgrade your wiki to a new version that has higher requirements than those available on your old server (like php version).

The steps are basically explained in other pages:


 * 1) Make a backup of your wiki.
 * 2) Transfer backups from the old server to the new one.
 * 3) Restore the backup on the new server.

Upgrading the new server
If you are upgrading to a newer MediaWiki version on the new server, instead of copying the old MediaWiki directory and extensions to the new server, you should follow the upgrading procedure. You'll download a new MediaWiki version on the new server and fresh versions of the extensions you use, matching the new MediaWiki version. Remember to run the update script.

Test
At this point, try to use the wiki on the new server. Log in as a sysop and a regular user and check that viewing, creating and editing pages and uploading files still works. Fix any problems reported either by PHP or MediaWiki itself.

You can do the entire process to test if the move will work without problems, before actually putting the old wiki in read-only mode. Once you know your wiki in the new server works as expected, you can put your old wiki in read-only mode and perform the move again.

Frequent problems

 * Inaccessible files after changing the domain

The column md_deps in the module_deps table contains absolute file paths, which are used to locate the images and LESS files that CSS depends on. These paths break when the wiki is, e.g., moved to another folder or another server. After your move, you might see PHP warnings that certain files could not be accessed. In current versions of MediaWiki, this can be solved by running update.php, thus clearing caches.

In versions older than MediaWiki 1.25 (where T37472 is not implemented), update.php does not delete the contents of the module_deps table. For these versions, the workaround is to manually fix wrong entries in the module_deps table:

This can be used to update wrong path segments and to fix the error.

A similar issue can happen when MediaWiki tries to read resource loader messages. In this case the solution is to truncate the according tables: