How to Move WordPress Website From Localhost to Server

Feb 25, 2019

How to Move WordPress Website From Localhost to Server

Feb 25, 2019

A good many of you may choose to build your website on your local computer to test site changes, themes or plugins without the risk of breaking your live site. And with good reason. Working on your website locally enables you to develop your site more efficiently until it is ready for the whole world to see.

Software such as Bitnami (for both Windows and Mac) enables users to build a site locally. The next step in this process is pushing it online, which is a whole different ball game.

Also, there are two ways you can move your WordPress website from localhost (i.e. your local system which could be a laptop or desktop) to the live server (live website).

As with everything WordPress, one of the methods involves the use of plugins that help you with the move/migrate. The second method involves extensive manual effort. We wouldn’t recommend this method to beginners (or the faint-hearted) because of the complexities involved. But users who are well-versed with the WordPress environment can follow the manual method.

We shall provide a step by step guide to help you through both the processes. Let’s begin with the first method, using a plugin.

1st Method: Move WordPress from localhost to live server using a Plugin

The WordPress repository will give you an array of plugin options to choose from, but we are going to use All-in-One WP Migration for its ease of use and fast processing ability. Let’s begin!

Step 1: Open the dashboard of your Local WordPress website and then select Add Plugins. Search for All-in-One WP Migration plugin. Install it and then Activate it.

click to install all in one wp migration plugin

Install the plugin

Step 2: On the dashboard, the All-in-One WP Migration option appears on the side panel. Click on it, and it’ll reveal three options. Then select Export. And a drop-down menu will appear.

select export all-in-one wp

Dashboard side-panel

Step 3: Open the drop-down menu and select File. It’ll start downloading your local WordPress website. It’ll take a while for the download to complete. So instead of sitting around twiddling your thumbs, go make yourself a cup of coffee.

export to file

Export site

Step 4: Next, open the dashboard of your Live WordPress website (assuming that you already have a website ready) and select Add Plugins. Search for All-in-One WP Migration plugin. And then Install and Activate it. (Alternatively, you can download the plugin from WordPress plugins repository)

Step 5: On the dashboard, the All-in-One WP Migration option appears on the side panel. Click on it, and it’ll reveal three options. And then select Import.

Step 6: From the page, simply click on Import From, and it’ll reveal a drop down. From the dropdown, select File. And then choose the file that you just downloaded from the Local host server (assuming that the download is now complete).

import to file

Import site

The plugin will notify you when the import is complete, and you’ll be asked to log in to your website.

And that’s it, folks. Using the All-in-One WP Migration plugin, you have successfully migrated WordPress site from your local server to live server.

Now for those brave enough to opt for the manual method, follow the steps as explained in our next section.
Note: We would highly recommend beginners give the manual method a slip, or if you are insistent then have a go at it under the supervision of someone who is well-versed with the WordPress environment.

2nd Method: Transfer WordPress from local host to live server Manually

To manually move your site, do the following:

i) Migrate WordPress Files of your Local site to the Live site

ii) Migrate database from the Local site to the Live site

First things first. Here are the steps to follow to migrate your WordPress files to the live site.

i) Migrate WordPress Files of your Local site to the Live site

Step 1: Download (if you don’t already have one) an FTP client like FileZilla. Then connect the client FileZilla with your web host.

How? Let us elaborate.
Simply open Filezilla, and on top of the window, there is an option to connect. Simply insert your FTP credentials – Hostname, Username, Password, Port and hit Quickconnect. (Here’s how to find out the FTP credentials of your web hosting account on SiteGround, 1&1, HostGator, DreamHost, and GoDaddy. If you are using any other hosting company, reach out to them.)

filezilla connect


After making the connection, you can migrate WordPress Files of your Local WordPress blog to the Live WordPress site.

filezilla - local site to live site

My live site/remote site

Step 2: To move WordPress Files of the Local site to the Live site, simply select the local site files and right click. A drop-down menu appears. From the menu, select Upload.

click to upload wp file original

Upload file

The process will take a while to complete. In the meanwhile, let’s go ahead and move the Local Database to the Live Site.

ii) Migrate database from the Local site to the Live site

Step 1: Transfer the local WordPress database files of your Local site. To do this, you’ll need to access phpMyAdmin page.

Normally, users can access phpMyAdmin through the web host account. But a local WordPress site is not hosted by a web host. You can still access phpMyAdmin. Now, add /phpmyadmin at the end of the local website.

For instance, my Local WordPress website URL is – localhost:8080

I added phpmyadmin at the end of the URL – localhost:8080/myphpadmin

phpmyadmin local site

Sign in to phpMyAdmin

Step 2: To log in, use the username root and the password that you use to access your Local WordPress website.

Step 3: Now select the database – the local database generally has the name WordPress in it. And then choose to Export to export your database.

export from local host

Export database

Step 4: In the Export page, choose Custom – display all possible options.

custom export

Custom export database

And then Scroll down.

Step 5: From the Compression option, select gzipped.

gzipped output

Download database in zipped file

Step 6: The next step is to select the following:

From under Object creation options, select Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT / TRIGGER statement

From under Object creation options, select IF NOT EXISTS (less efficient as indexes will be generated during table creation)

Also select, AUTO_INCREMENT value

Also select, Enclose table and column names with backquotes (Protects column and table names formed with special characters or keywords)

Now, scroll down and hit Go
That’ll export the local host database to your computer. Next, you’ll need to upload the database to your Live website.
Step 7: Create a new database on the Live site. In this new database, you’ll upload the local host database that you just download.

To create a new database, log in to your cPanel dashboard of your web host. In the dashboard, under the Databases section, you’ll find an option called MySQL Database. Selecting it will take you to a page where you can create a new database. The database name is bhwpsite_TestSufiasBlog.

Create New Database

Create a new database

Step 8: On the same page, scroll down and create a new user. We created a new user named bhwpsite_sufiab.

add a new user

Create a new database user

Step 9: And then add the new user to the database.

In our case, we added bhwpsite_sufiab (user) to bhwpsite_TestSufiasBlog (database).

Add user to database

Add the new user to the database

Step 10: As soon as you add the user to the new database, you’ll be taken to another MySQL page for setting privileges for that user. Check the All Privileges box, it’ll grant you all kinds of access and permissions.

manage all mysql priviledges

Grant the new user, all database management privileges

Step 11: Next, open the phpMyAdmin from your cPanel and choose the new database and then select Import. In the import page, upload the Local database that you had downloaded in Step 5. Then click on Choose file to upload the database. Scroll down and, press Go.

import to new database

Import new database

Step 12: Now, the next step is to replace the links that are still pointing to the local site. In the phpMyAdmin, look for the wp_options table in the new database. On the sidebar, click on the + button of the new database and a dropdown will appear. From the dropdown choose the wp_options table.

wp-options table

Select wp-options table

Step 13: In the wp_options table look for siteurl. And then click Edit option to edit siteurl. We’ll change the site URLs.

siteurl wp options table

Edit site URL

Step 14: In the input box, you can see the URL of the Local site. Replace it with the URL of your Live site.

For instance, we replaced with

local site url

Replace old URL with the new one

Save the changes by clicking the Go button.

Replicate the same steps for the option_name home.

home wp-options table

Edit home

Step 14: At this moment, if you try opening the Live website, it’ll show you an Error Establishing Database Connection error. That’s because the new database is not connected with the Live site.
To make that connection, open FileZilla and find the wp-config.php file. In general, the config file is found in the public_html folder.

finding wpconfig

Select WP Config file

Upon finding the file, right click to View/Edit. Look for the following:


Replace this with the name of the new database that you created in Step 7.


Replace this with the name of the new user that you created in Step 8.


Replace this with the password of the new user that you created in Step 8.

Save the changes and then upload the config file back to the server. You should be able to open your live site without facing any connectivity error issue.

Step 15: Log into your live site dashboard and go to Settings > General. And without making any changes, simply scroll down and then click the Save Changes button. Revert back to Setting again and choose Permalink. Then scroll to the bottom and select Save Changes. We took these steps to ensure that the site URL and all the posts links are working fine.

general permalinks

Navigate to Permalinks

Note: Although you changed the site URL in the database in Step 12, this does not change the URLs (of the local site) that you have previously added in your posts and pages. There are two ways of fixing this.

Step 16: Either use a WordPress plugin called Velvet Blues or run a SQL query.

Using Velvet Blues – Add the plugin to your website The plugin allows users to fix old URLs in experts, content, custom fields etc. After activating the plugin on your site, go to Tools and then to Update URLs.

In the Update URLs page, you’ll be asked to enter the Old URL (URL of the local site) and the New URL (URL of the live site). Then you can choose to update the URL of all content of the site – including pages, posts, and even revisions. Also update the URL in excerpts, links, and attachments like images, documents, etc.

Running a SQL query – Open phpMyAdmin, and then click on the new database and select SQL from the menu on the top. And in the text input field, write the following code:

UPDATE wp_posts SET post_content = REPLACE(post_content, ‘localhost/test/’, ‘’);

Note: Be sure to change ‘localhost/test/’ to the URL of your local site and ‘’ to the URL of your live site.

Take a look at the images of your posts. Fix them if they need fixing. After you fix images and broken links, you have successfully completed moving WordPress localhost files to live server.

We hope that this beginners guide article helped you get your local site online. For more WordPress tutorials and guides like this, take a look at our WordPress blog.

how to move wordpress from localhost to server
Share via
Copy link