Moving your WordPress website? Why would you do that? For example, if you regularly get 503 and 404 errors that cannot be explained and your entire website is down. Your website is completely up to date and yet it remains a misery to keep your website up to date. A website that doesn’t function properly will cost you money and customers. So it’s time to move.
You have searched for
good WordPress hostings are out. But then you’re scared. How are you gonna handle this? And everything on your website will stay the way it was? Don’t you lose anything? And your e-mail, is it moving with you? A lot of questions. What’s involved in moving your WordPress website? Read it in this blog.
The purpose of this blog is -as you’re used to- not to give you a complete step-by-step plan for the move of your WordPress website. There is no standard step-by-step plan anyway, as this differs per website. Or not quite: the difference is in the operating system on the server of your hosting party. It is possible that Direct Admin, Plesk or Cpanel are used. Generally speaking, the steps to be taken to move a website are the same for all these systems.
We move an average of 4 to 10 WordPress websites per week and yet we still regularly encounter special problems. The main goal of this blog is to give you insight in the process of moving a website and to give you a structure if you want to do it yourself.
1. Always make a backup of your website before you move.
The first step you should always take before you start tinkering with a live website anyway, is to make a good backup. What is a good backup? It is a complete backup of your website containing all files and a complete export of the database. How do you make it? There are several ways to do this. The first is that you use a backup plugin such as
WPbackup. If you search for ‘backup’ in the WordPress plugin repository you may find more plugins that can make a full backup.
The second is that you download all folders and files via FTP (with for example a program like FileZilla) and use PHPMyadmin to make an export of your database.
A third option is to use the control panel of your hosting party to make a backup on the server and download it when it is ready. For this we use the backup function of DirectAdmin but you can do the same within Cpanel or Plesk.
We have already written about backups in several blogs, including the blog about the
plan of approach for website maintenance. It remains an important but much forgotten item if you own a WordPress website.
Create a folder on your local computer. Here you save all downloaded folders, as well as an export of the database, so you can easily find them later. If you have used a backup plugin you can download and unpack the backup you made. Then you also have all folders and the database locally.
Possibly you can still download the files via FTP and download the database whether or not zipped from PHPMyadmin.
2. New hosting for your website
It doesn’t matter where you requested the hosting. You will always have to set up the storage space for your website. Most hosting providers use a control panel. This can be Cpanel, DirectAdmin or Plesk. There are also several other providers that offer a custom control panel. This in turn depends on the operating system used on the server and the size of the provider.
In any case, request a new hosting package from your new provider. In this case, we take DirectAdmin as an example, because we often work with it ourselves and we also encounter it a lot with our customers. So you don’t have to request the domain name from your new hosting provider at this stage, you can do that later on.
The moment your hosting provider gives you an account and you can log in to Direct Admin of the server, you have the possibility to create an alias. What is that? Simple, your website is not linked to a domain name, so it can only be found based on ip-address. So to make it easy to create an alias. So instead of 22.214.171.124 for your WordPress website you can now find it on tijdelijkeurl1234.nl or something similar. More information about this can be obtained from your hosting provider.
If you don’t want to create an alias but still want to test if your website is at the right location without having moved the domain, you can change your hostfile. This works a bit easier on a mac than on a Windows Computer but it is possible on both systems. On a Mac, set the host file as follows:
Type: sudo nano /private/etc/hosts and enter
Enter your administrator password
Complete with 126.96.36.199 (the ip-address of your server) yourwebsite.nl
Close with Ctrl + X and save the changes
For Windows there is a similar way to modify your host file, for this I refer you to Google.
If you go to yourwebsite.nl now you will see your website through the new server.
Now install your WordPress site on the new environment. There are three ways to do this:
You download all files from WordPress.org and upload them via FTP to the right folder on the new server and create a new MYSQL database. Make sure you save the login details of the database, you will need them during the installation. Next you start the famous ‘
5 minutes installation’ of WordPress.
Use for example Installatron. With this the provider gives you the convenience that in your control panel you only have to choose which package you want to install and then they automatically take care of the rest.
The provider installs WordPress on your environment immediately after requesting your hosting package.
Your WordPress installation on your new server is ready. But not for long.
3.Moving WordPress website
3.1 Moving files to new hosting
In the first step you made a backup of the database and all your files. The database comes in the next step, what you need now is the folder
wp-content-out the backup.
Upload this folder via an FTP client such as
Filezilla (free) or
Yummy FTP (paid) to the same location that contains wp content. Here you will also find the folders wp-admin and wp-includes. You can leave all folders and just copy WordPress wp content over them. If you are asked to overwrite files, you can do so without any problems.
Make sure that you really only transfer the contents of the named wp-content folder, not accidentally the individual files such as wp-config.php that are outside this folder. This is where the database data of your new installation will be stored. If you overwrite these you will not be able to connect to your new database anymore and if you are unlucky you can start over again.
After copying the files, you can see if your website works, but that doesn’t make sense. So don’t be alarmed if you do it anyway and you don’t see anything or you get an error message.
3.1 Moving the database to new hosting
WordPress websites use a MYSQL database. Meanwhile there is a database filled with the tables of the newly started WordPress website. There are several ways to import your database.
Via PHPMyadmin. Disadvantage of this is that it is very error prone. Especially if the database is a few MB’s large, you often run into problems.
Via BigDump. This is a script that you place on the new webserver in the root of this server. Also an export of the database (from your backup for example) is placed in the root. Next you go to /bigdump.php and import the old database to your new environment. More about BigDump can be found at
the developers’ website.
So after moving the database you have the complete old website on the new server. But it still won’t work. And why? There are references in the database. And these all refer to your old website. If your domain name has not changed, you can skip step 4 and immediately get started with step 5, moving your domain name.
Last point of attention is the prefix of your tables. By default, this is wp_ (of course you have not because
you’ve read this so you’re aware it’s a security risk). Adjust the prefix to the prefix of your imported tables in your wp-config.php file.
4. Search and replace in the database
Your database contains references to your old domain. If your complete domain name now change, so your website was for example and it becomes, use the tool I describe in
this previously published blog about searching and replacing it in a WordPress database.
After searching and replacing in the correct url of your website you can check if your website is running at the new location. This will still be on a temporary location if your domain name remains the same. This is because your domain has not yet been moved.
5. Mail moving
An important step in the process of moving your website is your mail. Of course, this only applies if you use the mail via your domain. The most important thing is that you know whether you are using POP3 or IMAP. Very simply explained: POP3 means that you download the mail from the server. IMAP stays on the server and you can view your mail wherever you log in.
Be the first on the new server to create the same mailboxes you had on the old server. And save the login details.
But how do you move the mail? For POP3 it’s easy, then it’s just a matter of setting up the new mail servers on the devices where you get the mail. For IMAP there is more needed. Globally you have two options:
Connect the old and the new mailserver in for example Outlook and move all folders from old to new;
you use the
IMAPSYNC. This is for advanced users, you need to be familiar with the commandline on your server.
6. Moving Domain
The last step in moving your WordPress site is moving your domain. If you have chosen to move your website to another domain, you can skip this step. Maybe you still want a
301 redirect settings so that people who visit your old domain are automatically redirected to your new domain.
First you need a transfer key or token from your old hosting provider (registrar). This is a unique code. Without this code you simply cannot move. It differs per provider, there are providers where you can get this code directly from the control panel, other providers mail the transferkey to you when you have given up and for others you have to request the code by mail.
In any case, providers are obliged to give up this code if you have fulfilled your obligations. If you have problems retrieving this transferkey my advice is to contact the
Foundation for Internet Domain Registration in the Netherlands. They manage the .nl domain names.
Also note that there may be a lock on a .com domain name. This means that it cannot be moved. You will also have to arrange this with your hosting provider.
Since every provider has its own way of registering a domain, I won’t go into that further. What I do want to give you:
A .nl domain is transferred immediately. It can take up to 24 hours before all DNS servers are aware of the change;
Moving a .com domain often takes five days before it is actually transferred;
for a .be domain, a separate transfer form needs to be filled out and submitted.
7. Cancel old hosting
If this was your only domain with the old hosting provider you can delete all files via FTP here. You can also delete the database. Why would you leave data where you don’t do anything with it anymore? Which steps do you follow to delete the whole package?
Delete the database;
8. Conclusion about moving a WordPress website
Did you get dizzy or was it all easy to follow? The blog’s approach this time was quite technical. As mentioned in the intro, I didn’t want to tell you step by step how to move your website. There are too many variables to think of. Per hosting provider there is already a difference in the control panel to give just one example. What kind of problems have I encountered in the meantime? I will give a top 5:
PHP versions on the servers differ. A website that runs fine on PHP5.4 does not have to run smoothly on PHP7. Meanwhile the version of PHP 7.3 is stable so make sure your hosting is running it as well and check this;
database corrupted. Often you will see errors during import. The best option is to adjust the export manually until there are no more errors. It can also happen that the phpmyadmin version differs from server to server, if you run into this my advice is: Google on the error message and see what you need to change in the downloaded database file;
WP-Config file accidentally copied. It’s your own fault but it can take a lot of time before you find the solution;
unstable FTP connection without error. Files get corrupted while uploading. If you suspect this, please upload again. Preferably complete, so first delete everything;
transferkey will not be accepted by new registrar. Double check the key before contacting the old provider. I have already received the wrong transfer key several times.
Domain name locked. A .com domain name may be locked. This means it can’t be moved until the lock is removed. So if you are going to transfer a website, ask immediately if the .com domain is possibly locked and if they can remove it;
website gives a white screen. Possibly you have a plugin conflict on your new server. Test this by temporarily renaming the plugin folder to old-plugins for example. The same goes for the theme. Rename the theme folder to old-topic if renaming the plugins doesn’t work. And of course check the
error log on your server.
8.1 Moving a WordPress website with duplicator plugin
Besides the manual method we have described in this blog there are several plugins that can make the move easier for you. The most famous of these is the
Duplicator WordPress plugin. Our experience with this plugin is that it is used for
Our experience with this plugin is that it works fine for a basic website but as soon as it is a bit more complex, for example a larger database, a lot of plugins or something like that, the chance of errors is high.
We wrote earlier that it’s not a step-by-step plan as all moves of websites are often just a little bit different. But it seems useful to us to list all the global steps one more time.
Make a full backup of files + database
Create a hosting package with your new hoster
Install WordPress with your new hoster
Copy the wp content folder to your new hosting environment
Import the backup of your database into your new hosting environment
Customize your wp-config so that it contains the correct database data
Move your domain name
Move your email
Do you still dare to take the step after reading the blog? Or do you need help moving your website?
Then feel free to contact us and we will contact you as soon as possible to help you further.