Whether you’re changing hosting providers or trying to clone a WordPress site to jumpstart a new project, rest assured that you can copy, migrate or rename your site in a matter of minutes. But there are a couple of details with the inner workings of WordPress that can cause problems. The following step-by-step tutorial will guide you thru a simple, full-proof procedure that works every time.

Summary
The best-practice process is the same for migrating as well as renaming a WordPress site. You should create a full backup of your site, store your backup to a remote location, and then use the backup file to restore the site data to a new site at the new domain as per the following high-level work flow diagram. The reason that the process is identical is because the locations of the source and destination sites are arbitrary.

To move your WordPress site to a new location you obviously need to begin with a complete backup of your existing site. But this is complicated for a couple of reasons. First, WordPress makes use of multiple storage formats to persist the data on your site. Specifically, WordPress stores your site’s system files, uploads, plugins, and theme files on the Linux file system. But it stores the html content of your web pages as well as your site’s configuration data in MySQL. Further complicating matters, there are a variety of strategies for hosting your site’s static content (images, CSS and Javascript files) that needs to at least be taken into consideration when creating a full site backup.
Secondly, WordPress stores configuration data for your existing site that might be incompatible with the hosting environment for your destination site. For example, WordPress stores the full URL for your site in MySQL which turns out to be a conundrum as there’s no direct way to switch out the old URL with that of the destination URL. Plugins that you might have installed on your WordPress site, particularly performance caching and site security plugins, might also collect configuration data that is specific to the infrastructure of your source site and would thus potentially break your destination site. We’ll look at how to address both of these potential problem areas below.
Work Flow
1a. Install UpdraftPlus WordPress Backup Plugin On Your Source WordPress Site
UpdraftPlus WordPress Backup Plugin is the WordPress community’s most widely-used backup solution. It is a free downloadable plugin that provides a complete backup solution with a broad range of remote backup file storage options. It is popular both because it is free and because it is highly reliable. Updraft backs up your WordPress system files, plugins, uploads, and theme data and compresses all of these into several individual archives grouped by type of data (database, plugins, theme data, uploads, other). You can use any other backup system if you want, provided that backs up all of the same data, and it provides a way to store your backup file remotely.
If you’re installing Updraft in order to follow this tutorial then you can use the plugin installation wizard’s default options, though separately, I highly recommend that you consider setting up a remote storage service like AWS S3 at some point.
1b. Note The Settings of your UpdraftPlus Plugin Configuration
We’ll need to know the exact Updraft configuration settings for step 7, so you should either screen shot or record all of your configuration settings now. The nature of your Updraft settings will vary depending on your choice of Remote Storage (see screen shot below). Some of the available configurations, for for AWS S3 for example, include access keys and passcodes. It is important that you have these available for step 9 that follows.

2. Install Velvet Blues Update URLs WordPress Plugin On Your Source WordPress Site
One of the common challenges with migrating a WordPress site is that there are typically hundreds or even thousands of links in your current site that reference your current site using its fully-qualified domain name. Thus, after having migrated your site to a new domain name your site’s content now includes lots of bad links that incorrectly point back to your old site. If both your old and new sites are running then you might notice that your new site immediately sends you back to your old site each time you click on an internal link, and, that your images and other media are still being served by your old site. yikes!