Ultimate guide to WordPress Migration

Author picture

WordPress migration is usually easy but it can become a nightmare if you have no experience and want to migrate a huge site with a big media library. 

In this post we will try to explain step by step how to perform a successful migration.

1. Pre migration tasks.

The most important part is to make sure you have a full backup of your site – so all your WordPress files and your database needs to be backuped. There are multiple ways to do a proper backup – we are usually using our Kinsta server tools for that.

Make sure you have full access to your staging and live environments, a good practice is to migrate the website to a temporary url on a new server and then change the domain and replace url addresses in the database.

This is very easy with a Kinsta server because usually you can change the urls and domain within their control dashboard, don’t worry if you’re not using kinsta. There are many other server providers – if it’s a WordPress dedicated one you should have the same tools to do it easily.

2. WordPress migration with a plugin.

There’s a huge selection of wordpress migration plugins on the market today, at least 10 you can choose from. We will write about 1 because we’re used it for multiple projects and it never failed.

WP Migrate DB Pro

We think it’s the best option in the Market because it has many awesome features and is easy to use.

If you decide to use the “plus” version you will be able to migrate the database, media files, themes and plugins. There’s also a WP-CLI integration.

You can easily block a site from being pulled or pushed – this is very helpful if you’re doing a lot of migration and this is a part of your “deployment” workflow.

Here you can check all the docs and see if it’s a good fit for you.

In the newest version of the plugin you can use their (still in beta – but working excellent) new migration option. You need to enable the High-Performance file transfer option and you can move very big sites way faster than before. You can read more about their approach in this blog post.

3. Manual migration

You can also do a fully manual WordPress website migration and here’s a step by step guide how to do it.

  • Transfer your files – there may be many scenarios, but usually you want to move the entire page and thus you have to move the theme, plugins and media so basically the whole WordPress install with all folders that are inside. Please do not use simple ftp to move all the files because it will take forever :). There are some nice and simple ways to do it faster. We are preparing a post for that so right now we recommend checking stackoverflow.
  • Export your database – you can do it with multiple plugins or just use phpMyAdmin. Just open your phpMyAdmin dashboard, select the database you’re interested in and then click the export tab. There are multiple options to choose from but usually you can just select the “quick” one and click the “go” button.
  • Import your database – first you need to create the new database in phpMyadmin, then you need to open it and choose the import tab.
  • Replace the path’s in the new database
UPDATE wp_options SET option_value = replace(option_value, 'oldurl.com', 'newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';UPDATE wp_posts SET guid = replace(guid, 'oldurl.com','newurl.com');UPDATE wp_posts SET post_content = replace(post_content, 'oldurl.com', 'newurl.com'); UPDATE wp_postmeta SET meta_value = replace(meta_value,'oldurl.com','newurl.com');
  • If you happen to have problems with your site a good practice is to add some extra code into your wp-config.php file.
define( 'WP_HOME', 'http://example.com' ); 
define( 'WP_SITEURL', 'http://example.com' );

4. Final Thoughts

As you can see WordPress website migration is not hard, there are some important things that you need to do before you start like the most important thing – backup. If you do it you can easily restore your site in case of a failure. One thing is for sure – the more times you do it, the easier it will be.

If you still have some problems with a migration you can always reach to our team where you can get some help – we are open to any type of cooperation.