Moving a WordPress Installation from Localhost to Live Server

When you build a website on your own computer, we call it a local server. It can also be a network of computers as is the case with web developing companies.

Once the website is completely built, it is time to upload the website with all its files and folder to the web server from where the website would go live.

We call the web server as a live server.

The reasons why people first develop a website on a local host are very obvious. It is because of the easiness and the speed of development.

You can run, edit and debug instantly which would have taken so long if the developmental work was done on a live server.

In this article, we will illustrate the steps required for moving a WordPress installation from localhost to live Server.

You might be aware that you can install WordPress on your computer using Wamp and Mamp in Windows and iOS respectively.

Once you have installed WordPress and developed your website and tested it, you should know that there are three ways of moving a WordPress installation from local server to live site.

localhost to live server

The first way out is manually doing it and the second way out is using plugins like BackUpWordPress and the third way out is by using WordPress Import Tool.

Pre-Requisites Of Moving a WordPress Installation from Local Server To Live Server

There are a few things you have to ensure before you can start the process.

You have installed WordPress on your local server.

You have completed the website development and testing with standard folder structure.

You have bought the web hosting space or plan from a popular web host.

You have installed PHP, WordPress, and MySQL on your web server space from the cPanel. Most of the web hosts provide one-click installation options for those. Do it and follow the next step.

Download FTP software like Filezilla so that you can upload your website from localhost to live server.

Moving A WordPress Installation from localhost to live server (Manually)–

Step 1 – Export The Tables From Database

Open your web browser and in the address bar type – http://localhost/phymyadmin

Make sure your Wamp or Mamp is running. Once phyMyAdmin user interface opens, you will find the Export option on the top menu. Click on that and then select all the tables and click on Go button to start downloading the database.

thumb 26

Step 2 – Uploading Through FTP

Now open FileZilla and connect it to your web server by logging into your account. Once the connection is established, you will see the web folder structure appearing on the remote site.

On the other hand, your local host folder structure will appear under local site area. Select all the folders from the local site that are relevant and related to the website you have developed and after selection, right-click on it and click on Upload option. Remember to upload the folders directly under public_html.

thumb 27

Step 3 – Creating Database On Web Server

It is important to note that you have exported the tables from your local server using phpMyAdmin rather than the whole database.

Therefore, you need to create a database with the same name on the web server. For that, you have to go to your web server account’s cPanel and under Database/Web Tools option, click on MySQL.

thumb 28

It will give you the option to create a new database and provide the name. You would then have to create the users and add them to the database. You can grant different privileges as per your requirement. Your database creation is complete, and it is time to import the tables.

thumb 29

Step 4 – Importing The Tables

Go to cPanel and then to phpMyAdmin. You will find your database that you have created in the last step. Select that and then click on Import option.

Then select the exported file saved on your hard drive after clicking on Choose File option. Finally, click on Go button to let it import the file and complete the database creation.

thumb 30

Step 5 – Setting The Site URL

Under phpMyAdmin, look for wp-options table assuming that you have created the table as per the standard WordPress format. You have to browse the table and set the options value of the option name –siteurl as the URL of your website which is like www.mysitename.com.

thumb 31

Similarly, find the option name Home and change the option value to your website URL.

Step 6 – Configuring Your Site

It is time to configure your WordPress website. Just to recapitulate, you have uploaded all the folders and imported the database.

Go to your FTP again and find the file wp-config.php and edit it. You will see that it contains fields to write database name, username, and password. Provide them as you created them on the web server.

thumb 32

That’s it and now check whether your website is online by typing the URL into the web browser.

Note that you may have to change the permalink and fix some broken links which you can do from Settings option from the Dashboard.

Moving A WordPress Installation from localhost to live server (Import Tool Option)–

This is not a recommended option through it works fine. This is applicable for those websites that are very lightweight and hardly have any extra functionality other than the theme files on the local server.

Step 1 – Configuration

First, make sure you have installed WordPress and log into the Admin Dashboard. Now, go to the Wamp folder on your local server and select the folder where your site is stored. Zip it with the root folder as the website name and store it in your hard drive.

Step 2 – Importing

Then come back to Admin Dashboard and click on Tools and then to Import option. Select WordPress and choose the Zip file stored on your hard drive and let it upload.

thumb 33

There are a few things you need to note well. Once the uploading is done, you have to manually set the exact theme you used for your website on the local server and then you have to set menu option and other widgets.

Since it requires a little bit of expertise and experience, we recommend using this method only when you are using WordPress interface or software on your local server instead of raw PHP or Wamp.

Then you can export the entire website and import it easily without a headache of manual setting.

Related Post: Migrating your WordPress Site into New Hosting

About Sonl Sinha

Sonl SinhaSonl Sinha is a passionate writer as well as WordPress and WooCommerce rockstar who loves to share insights on various topics through his engaging blog posts. He runs a successful website design and digital marketing company. With 15+ years of experience in WordPress theme development, he strives to inform and inspire readers with his thought-provoking content. He helps thousands of small and medium businesses and startups create a unique online presence. Follow Sonl Sinha for your regular dose of knowledge and inspiration.

Do check out our free WordPress themes and WordPress themes bundle