Here is a step by step guide to moving WordPress to a new server using the free Duplicator plugin, which makes migration a much simpler process.

Initialize Your New Server

You do need to configure your new server so that you have a new IP address to point your test domain to (described later). You might use our Guide to Installing WordPress at Digital Ocean to set up a new server. With the Duplicator plugin, you do not need to install WordPress on the destination server. So, you can stop the tutorial steps right before the Installing WordPress section and return here.

You can also sign up for an account at Digital Ocean. If you’re looking for a quality domain name registrar, I prefer NameCheap.

When you’re moving WordPress, it’s a good time to explore other hosting options. I often recommend WP Engine as a robust managed hosting provider. Their plans start at $29 per month and often have discounts.

Preparing WordPress for the Migration

Background

Your WordPress site has four major components that you will need to migrate:

Domain name records pointing to your current server e.g. yoursite.com A record pointing to 192.107.45.132

Configuration files, such as the Apache site conf file and any custom PHP ini settings. If you’re moving from a managed host such as WP Engine, then you’ll have to create these from scratch as shown below.

Having a shorter TTL makes it easy to point your domain at the new server and then switch it back to the old server if you encounter any problems. It also ensures that you can start publishing on your new server quite quickly. If you don’t set your TTL, you might have hours of downtime.

Visit your DNS or domain name registrar to do this:

It’s best if you can change the TTL for your domain name a day before you migrate your site – but even a few hours ahead is fine.

Set Up a Test Sub-Domain For Your New Server

Create a sub-domain or test domain name with DNS A record pointing to the IP address of your new server. This will only be used to verify that the new site works before you switch over your primary domain name. e.g. create an A record for test.yoursite.com pointing to the IP address of the new server you set up above such as 192.15.108.17.

Optionally, you can create a second sub-domain pointing at your old server – which can be useful for logging in and accessing files after you complete the transfer. e.g. old.yoursite.com A record to the old-ip-address.

Install the Duplicator Plugin

After activation, click the Duplicator menu item in the Dashboard. You should see something like this:

Use Duplicator to Backup Your Site

Using Duplicator, click Create New, which will create backups of your WordPress directory tree and database. Click the Installer section and enter your test domain name in the new site URL. Then click next. Duplicator will scan your system and point out any adjustments that you need to make. When you’re ready, click Build.

The process will resemble the images below:

Once you’ve completed the package creation, click the Installer link to download it. Then click the Archive link. Preserve a copy of these files, as they are essentially a backup of your site. You will also need them to move your site to the new server.

If your site is small, this will work just fine. If your site is large, your PHP.ini settings may not allow such a large, time consuming download. Here a few options:

Another option is to log in to your new server and use WGET to download them over http from your old server. The paths are listed in the package description area. Larger files will only transfer if your PHP execution time has been extended as described above.

Prepare Your New Server

Install Unzip

Unzip will likely be necessary for Duplicator to decompress your site archive:

apt-get install unzip

Create Your Apache Configuration File

Create the directory for your WordPress site on the new server:

mkdir /var/www/sitename

Create the Apache configuration file for your site. Be sure to add a ServerAlias that supports your test subdomain or test domain. WordPress .conf files look something like this, but you can also use a copy of the one on your existing server.

Prepare Your Database and Permissions

Duplicator requires that you create an empty database and configure the permissions for it to install your existing site on the new server. You can do this easily with the MySQL administrator command line:

Verify Your New WordPress Site

Using your browser, visit your test domain name again e.g. http:///test.yoursite.com. You should be able to browse your entire site correctly. If you’re satisfied that the site has transferred correctly, you can continue. If not, you can post a comment below or visit the Duplicator plugin support area.

Note: If you’re using an .htaccess file in your old WordPress configuration, make sure that a correct copy of it was moved over to the new server. Sometimes files with the period prefix are lost in the transfer.

Cleanup and Secure Your New WordPress Site

First, we need to remove any remaining files from the Duplicator installation process. Log in to your new server and remove the Duplicator files:

Complete the Transition to Your New Server

Changeover Your WordPress Site URL

Using your new WordPress dashboard via your test sub-domain name, navigate to Settings -> General. Change the test domain name to your primary domain name. When you save the settings, your site will stop working temporarily until the DNS has caught up.

Point Your Domain Name to the New Server

Switch your domain name DNS to point to the new server. Change the A record to point to the new IP address. With the reduced TTL setting, you should start to see the new server running your site within a few minutes.

Verify Your Site on the New Server

Using your browser, test that your site has completely restored to the original domain on the new server. e.g. http://yoursite.com.

Note: I have noticed that using my approach, some themes settings may not change the URL back from the test URL to the original URL as desired. You may need to manually review theme settings to ensure that everything has switched back. In the worst case, you may want to browse the settings in your wp_options database table using PHPMyAdmin.

Archive Your Old Server

Once you’ve verified that your new server is running properly, you can decommission your old server. If you were running on a service such as Amazon AWS, you can create a final snapshot of your instance. If you’d like to make a manual snapshot do the following:

This is fantastic… and I’ve only hit one snag. After moving everything over, when I go to my “sharing” tool to set up social media auto-posting it goofs up. In a nutshell it opens the sharing portal to link, be goes back to the old page to link.
(morrobaydrugandgift.com… open sharing… click on Twitter share… confirm account… defaults back to rockharbormedia.com/MBDG, which is the sub-page I designed the sight on prior to moving over.)

I really Thanking U Very Much, Last two major website I developed twice, becos of not able to shift on other domain. This tool help me to save lots of time and give me the freedom to work on localhost – the fastest development options