The only problem is migrating to a web host can be a headache. No one likes to mess around with database tables.Fortunately, migration is simpler than it sounds and will take you not time at all if you follow the steps below.In this article, I’ll show you how to use the Duplicator plugin to quickly and easy copy a localhost WordPress installation to an online hosting account.
There are many different ways to migrate a WordPress site, but one of the easiest, by far, is with the free Duplicator plugin.
It’s an overwhelmingly popular plugin in the WordPress Plugin Repository, with a 4.9 out of 5 stars rating and more than 700,000 downloads.In the steps below, I’ll explain and illustrate the steps for migrating a localhost site with Duplicator. The exact steps will differ depending on your online server/host setup.
Before we get started, you’ll need:
It’s also important to note that you don’t need to install WordPress on the destination server before following these steps. Duplicator will copy across all necessary WordPress files for you.
Download and install Duplicator on your localhost site. The plugin is available for free in the WordPress Plugin Repository, so you can search for it in the plugin interface.
I’m using a beta version of WordPress 4.0, hence why the plugin interface says Duplicator is untested with my version of WordPress.
Once installed and activated, click on “Duplicator” in the admin sidebar and the Duplicator Packages interface will be displayed. Since I’ve just installed Duplicator, I don’t have any packages.
Create a new package in Duplicator.
So what is a package? A package consists of an archive of your site (the default is a .ZIP file) and an installer file that automates the process of setting up your archived site on another server.
Click on “Create New” to create a package.
The next screen will prompt you to name your package and make a few notes. It’s not really important what you name your package, though you might want to give it a memorable title if you plan to make multiple packages. Add a few notes if you want to.
Duplicator package setup.
There are optional Archive and Installer settings, but we’ll ignore these for now. The Archive settings allow you to filter your database, while the Installer options can be used to pre-fill the Installer screen so that it is setup at install time for future use. This can help speed up your overall install process.
Click “Next” to move on.
Duplicator will run a system scan to ensure the package build process will run smoothly. The scan step can help determine any potential issues. Passing all scan checks aren’t required in order to attempt a build, though the more “Warn” checks you get, the more likely it is you will run into issues during the build and install phases.
The scan didn’t uncover any major issues on my site other than large image files, which I’ll ignore because it’s unlikely the images will cause any problems in upcoming steps.
Duplicator system scan.
Click “Build” to create your package.
The plugin will begin backing up your site.
Building a Duplicator package.
As mentioned above, Duplicator will produce two files: an archive of your site (as a .ZIP file) and an installer file (as a .PHP file).
In order to install and unpack my packaged site, I need to copy the archive and installer files Duplicator created to my live site’s directory. I’m going to use Filezilla to do this with FTP.
Login to your site via FTP. Navigate to your public_html folder and copy the archive and installer files from your desktop to the folder. It may take a little while for the files to copy, especially if your archive file is quite large.
Copy your Duplicator package files (installer and archive) to your live site.
The next step is to install the archived site on the live server. To do this, we’ll need to access the installer file we just copied to the live site, by adding /installer.php to the domain.
In my case, the address is http://littleraewrites.com/installer.php
The installer interface will appear, prompting you to add your MySQL details. If you’re replacing an existing WordPress site (i.e. copying across an updated version of a site), you’ll need to enter your existing database details.
Test your database connection to ensure they are correct.
If you’re creating a new site, click “Create New” and enter fresh database details. Some hosting providers don’t allow the database creation option to work, which means you’ll need to manually create the database yourself.
Since my web host won’t let me automatically create a new database, here are the steps for creating a new database in cPanel:
Ensure you get a “Success” manage for both the “Server Connected” and “Database Found” tests before moving on to the next step. This will ensure you won’t encounter any problems during installation.
Make sure you get success for both fields before moving on through the steps.
Click “Close” and at the bottom of the installer screen check “I have read all warnings and notices”. Then click “Run Deployment.”
The installer will then begin installing your site on your live server. It may take a while for the installation process to complete if your site is quite large.
During installation, Duplicator will ask you to confirm old and new details for your site. Make sure they’re correct and click “Run Update.”
Duplicator will ask you to complete four more short, yet important, steps:
1. Install Report – This is simply a report detailing any errors encountered (hopefully none!) and the numbers of database tables, rows and cells created, scanned and updated so you can check the plugin has copied across your database information.
2. Save Permalinks – Click on the link “Save Permalinks” link and you’ll be taken to your new, live site where you can save your permalinks preference.
3. Test Site – When you click on “Test Site” it will open the front-end of your live site so you can check that everything is working.
4. File Cleanup – It’s important to remove the installer file and any associated files that were created during the installation process for security purposes. Click on “File Cleanup” to automatically delete these files.
And that’s it. Your live site should now be an exact replica of your localhost installation, only now it’s available online for all the world to see.
Do you use Duplicator to migrate sites? If not, what method works best for you?