Yesterday I was migrating a WordPress multisite network to a new server and as it has some different aspects to the migration of a WordPress only let's see how it is done, because although there are many common steps with a migration of a single site also has its peculiarities.
Why change a multi-site network server
There may be several reasons, but the reason Most usual to change a multisite network server is usually for memory or space needs .
Do not forget that a multisite network is an environment in which we offer sites, usually free, so there are multiple WordPress installations, each with their plugins, applications and scripts running, and all loading all that activity on a single (usually) database.
Nor is it to dismiss the question of  59009] disk space . In the network settings you can limit the space available for each site, but if your network is successful you just have to multiply the space you grant by the number of sites hosted to stay soon without the precious and expensive gigas that you have on your server.
In my case the problem was the available memory, because in the previous server I could not adapt to my growing needs the available resources, so I decided that the best thing was to migrate to a WordPress hosting in conditions, that would allow me all the necessary freedom and power, without this supposed a hole in my economy.
But let's go to it, to the server migration. The steps are the following …
0. Before starting
One step prior to all migration of a multisite network is disable all plugins so go to the administrator's desk of the network and disable them all.
1. Downloading files
The first thing is to have a copy of the files of the multisite network . There are many plugins but, in my experience, to migrate a multisite network it is better to do it manually by FTP or from the cPanel file manager.
The files and directories to be saved are the following:
- Directory / wp-content / and its subdirectories
- File wp-config.php
- File .htaccess
- Any file of your installation that is not WordPress
As the download of files can be of an important size my advice is that you make the copy of files by cPanel that allows you to create a compressed file of the chosen files and directories, that will be downloaded much more quickly, since the download file to file by FTP can be almost eternal.
It will also be the fastest option for subsequent restoration of the arch ivos.
2. Downloading the database
The next – and last – thing to download is the database, so access the panel of your hosting and load phpMyAdmin. Once in your database go to the tab Export and perform the export of all tables .
Most versions of phpMyADmin will allow you to choose between fast export and the personalized one; I recommend the customized one because you can export it in a compressed file download faster and also faster later restoration.
3. Install WordPress in the new hosting
Once we have contracted our new hosting the first thing is create a clean installation of WordPress which will be the subsequent recipient of our multi-site network.
This installation should not have nothing special, in fact you can use the automatic installer of your hosting (which I suppose that at this point it will offer it, but look for another one). If your hosting provider offers it, it would be a good idea to specify that the installation will be multisite, which will save you a later step that we will see.
4. Upload your copy of the network files to the new installation
Now it's time to restore the files and directories that we copy from our network, so upload them by FTP or cPanel, replacing the directories and files of the new installation with the ones you copied, except the file wp-config.php without taking into account these two possibilities:
- If your hosting allowed you to create the new multi-site installation do not replace the new file ] wp-config.php by the old one, because the current one will have the connection information to the database. The new file wp-config.php will already have the multi-site network configuration.
- If you could not make the new installation multi-site, do not replace the new file wp-config.php ] by the old one, because the current one will have the connection information to the database. Open to edit the new file wp-config.php and copy the multi-site network configuration of the old one and save the changes.
Come on, let under no circumstances replace the file wp -config.php new by the previous one .
As in step 1 of this guide I recommend that you use cPanel to upload the files because it allows you to upload a ZIP file and decompress it, which will greatly accelerate the process. You can do it by FTP but the process is long and slow.
5. Remove the tables from the new database
Go back to phpMyAdmin from the panel of your brand new hosting and once in your new database select all the tables in the box below the list of tables and , in the drop-down to your right called " For all the selected elements " click on the option " Delete ".
You will immediately be shown a screen in which you must confirm the deletion .
6 Import your copy of the database
Now that we have emptied the new database it is time for to upload the tables of the database of our network that we previously exported .
Go to phpMyAdmin , select your new database and go to the tab Import where you will have to select the file of the database that we downloaded in step 2.
The process is fast and automatic, and your tables will be imported into the new database easily. The only problem you might encounter in this step is the size supported by your hosting to import databases. If you exceed it, you will have to ask your hosting provider whether they care about the file or do it yourself, for example with WP-CLI or SSH .
7. Change the DNS servers
Once the physical migration is done you only have go to the management of the domain usually in the domain panel of the previous provider, and make the change of DNS servers from the previous ones to the new ones and wait for them to spread.
How long does it take? It depends. Everything has happened to me. As a general rule, any domain that is not a .es will take much less, even minutes, and .es domains can take from 1 hour in the best cases to several hours or even days in some occasions. The digital divide is called (sic).
One trick I usually use to know when the DNS server change has been made is to upload a text file of type hello to the new host. txt with a text that says " Hello, I'm already in the new hosting " and type in your url from time to time until you see the welcome text.
Una Once the DNS is spread, you should have your multi-site network on the new server without problems and with everything running as before. Also, since there has not been a change of domain, you will not have problems with URLs or redirections.
In any case, you may have some problem with plugin compatibility – mainly – since each server uses different versions of PHP and MySQL, and the plugin that worked well in the previous server can have problems in the new or vice versa.
This is innate with any migration, not only with multisite networks, and remember that you must always make migrations to improve, to have one more server safe and updated so if the plugin is the problem, for not being compatible with more current versions of PHP or MySQL, change plugin, do not deny a migration to a better server by an outdated plugin and vulnerable .
You will only have to go to the settings of your multi-site network and, if you deem it convenient, expand the space available for the sites, install new plugins, themes more advanced or whatever you want to make your users enjoy the advantages of the new server.
Any questions or additional advice?
I have made several migrations of multisite networks, and sincerely with this method I have never had any problem, but if you know any better way to do it do not deprive yourself and tell us in the comments.
Likewise, if you do not understand a step or have any doubt, plant it and I will try to help you.  NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.