Categories
WordPress

How to clone, migrate and restore a WordPress site from localhost to live server

The most satisfying advantage of having WordPress installed locally on your computer is that it lets you play with the site bringing any modification without breaking the live site. Most of the developers prefer working on localhost and develop their sites with all essential functionalities. Once you are done with developing your site locally, you need to move it to your live server. Yes, this is where we are taking you. In this article, we will talk about how you can migrate WordPress site from localhost to a live server.

If you are a beginner and don’t know much about installing WordPress on your localhost, read our blog post on how to install WordPress on localhost and develop your site then follow this tutorial to migrate WordPress site to a live server.

Migrating WordPress sites to live servers can be very challenging as there are different ways to go through. But, with this tutorial in hand, you will find it a lot simpler.

How to migrate WordPress site from localhost to web server

As mentioned earlier, there are many ways to migrate WordPress site from localhost to live server. We will show you the easiest way that works for almost everyone without leaving a single error. Here, we are going through the whole process with a WordPress plugin. Duplicator is that particular WordPress migration plugin that we are going to use today.

Duplicator has both free and premium versions. In our case, the free one will be enough to complete the entire process of migration successfully. So, no worries.

Here is the quick checklist of the steps we are going through.

  • Install Duplicator plugin
  • Create migration package (installer.php and archive)
  • Take installer.php and archive files to live server
  • Run installer.php
  • Complete the migration through few simple steps

Step: 1

Go to your local WordPress site’s dashboard and install Duplicator plugin there. You can download the plugin from the WordPress Plugin Directory and install it manually or you can go to Dashboard > Plugins > Add New, then search “Duplicator”, click “Install Now” and “Activate” subsequently.

How to clone, migrate and restore a WordPress site from localhost to live server 1
How to install Duplicator Plugin

Step: 2

Once you have activated Duplicator plugin, you are ready to go. Your Dashboard has Duplicator option at the bottom. Go to Duplicator. Create a new package by clicking on “Create New” on your right.

How to clone, migrate and restore a WordPress site from localhost to live server 2
Create New Backup package

After creating the package click “Next” to proceed on.

How to clone, migrate and restore a WordPress site from localhost to live server 3
Duplicator New Package Setup

When you click “Next” button, the system scans all files and the setup to check whether it is ready to go. You will see each one’s status once scanning is complete. Click on “Build” at the bottom.

How to clone, migrate and restore a WordPress site from localhost to live server 4
Duplicator Scan Complete

After a while the system gives you two files (installer.php and whole WordPress files as an archive in an auto generated name) Click on “Installer” and “Archive” to download these two files.

How to clone, migrate and restore a WordPress site from localhost to live server 5
Duplicator Scan Completed

Once downloaded, you have to go through the following steps on the server.

Step: 3

Now you need to take those two files to the web root/www/public_html directory of your server. To do this you need your server’s FTP/SSH credentials (e.g. username, password, server IP). You can use FileZilla to access your server’s root/www/public_html directory from your computer.

After connecting to your server via FileZilla, go to your website’s home directory (web root/www/public_html) and upload the archive and installer.php files from your computer to the live server. The process may take some time depending on your archive file size.

Below is the sample image of how FileZilla looks on Mac.

How to clone, migrate and restore a WordPress site from localhost to live server 6
Filezilla

Step: 4

When you have transferred the files to the live server, you need to access the installer.php file. Go to yoursite.com/installer.php. Select the checkbox and click “Next”. Just like the screen below.

How to clone, migrate and restore a WordPress site from localhost to live server 7
Duplicator Deployment

To proceed to the next step you require your server’s MySQL username and password. You can get this info from your hosting company’s support. Or if you have setup your own server (e. g. VPS), you should already know your MySQL credentials.

At this stage, you can either create a new database or connect with an existing one. Select the one you want to go with.

How to clone, migrate and restore a WordPress site from localhost to live server 8
Duplicator Install Database

Write your database name, database user name and password then test the database by clicking on the button at the bottom. Test result is shown right below. Now click “Next”.

How to clone, migrate and restore a WordPress site from localhost to live server 9
Duplicator Database Successfully Connected

After clicking on “Next” button there will be a pop up asking you to run installer with this settings. Click “Yes” to go ahead.

How to clone, migrate and restore a WordPress site from localhost to live server 10
Duplicator Install Confirmation

The progress will be shown on screen just like the image below

How to clone, migrate and restore a WordPress site from localhost to live server 11
Duplicator Final Installing

When the process completes, the system will take you to the subsequent stage. Check the URL, path and site name. Click on “Next”.

How to clone, migrate and restore a WordPress site from localhost to live server 12
Duplicator Update Data

Log in to your site by clicking the “Site Login” button.

How to clone, migrate and restore a WordPress site from localhost to live server 13
Duplicator Test Site

Once you are logged in, you can see the migration success notification on your Dashboard. Remove installation files from the number 2 link below the success notification message.

How to clone, migrate and restore a WordPress site from localhost to live server 14
Duplicator Successfully Installed

With the removal of the installer files, you are completely done with your migration process. You can see Duplicator documentation to know more about how it works.

There are more plugins in the WordPress directory that you can use to migrate your WordPress site . If you want to try any other plugin except Duplicator, you can go through our 5 best WordPress migration plugins round up to know which one will serve your purpose the most.

So, this is how you can migrate WordPress site to your live server. Now you can do whatever you want with your site live on your web server. Taking regular backups is also crucial. In case your site is hacked or disturbed by any unwanted modification, you can easily get your site back if you take necessary measures to backup your site. Thanks for being with me!

Contact me if you want to migrate your site?

First published on Themeum

By Murshid Alam

Organizer of Barishal WordPress Meetup, WordPress Enthusiastic and, Open Source Lover. Over the last few years, I learned web programming and worked with them locally. I also assist in designing, developing and testing websites too!

Before coming to web programming I was mostly involved with Electric Media(Channel i), Newspaper (Priyo, Bhorer Kagoj) and volunteering activities (including NGOs).

I love to contribute to the WordPress Community. I am always happy to meet new peoples in the WordPress community and see how I can help them achieve their goals. When I am not online and WordPress, I love to play football, travel, riding the bike and attend Meetup/WordCamps!

If you’d like, you can help me to attend WordCamps around the World.

Leave a Reply