Press "Enter" to skip to content

Move your WordPress site to Live Server

Many people develop their first WordPress site on their local computer. It has certain advantages like no one can see your site before it is completely finished. You can do as much experiment with your site as you want without the fear of breaking it. By the way if you want to install WordPress on your local computer then click on the link below. But what happens when you completed your website development. The next step is to move your WordPress site to Live Server. In this article I am going to show you how you can move your WordPress site to live server step by step. So without wasting time let’s start.

Steps to move your WordPress site to live server

Before we begin to move your WordPress site to live server you need to have few things in place. First I am assuming that you have a WordPress site running on a local server, and you have full access of it. Next you will need a web-hosting and a domain name for your site. You will also going to need a FTP program like FileZilla. Follow the steps below to move your WordPress site to live server.

Step1: Export WordPress Database

The first thing that we need to do is to export your WordPress site database in a SQL dump file. This file is used to recreate the database in the live server. Simply go to http://localhost/phpmyadmin and click on your WordPress database. Next click on the Export button from the top menu bar. See the image below

Move your WordPress site to live server

In the Export Method option, you can choose ‘Quick’ or ‘Custom’. Custom will provide you with more options but I will recommend you to choose Quick. Make sure format should be SQL. Click on the go button. See the image belowMove your WordPress site to live server

Step 2: Upload WordPress files to Live Server

In this step we are going to upload your WordPress files to live server. Open up your FTP program and connect to your web-server hosting account. Upload all your WordPress files in the right directory. For example if you want the site to be hosted on yoursite.com, then you would want to upload all the files in your public_html directory. see the image below.

uploadingwordpress

Step 3:Creating Database in your live server

The next step is to create database in your live server. Most WordPress hosting provide c-panel to manage the hosting. So use the c-panel to create a database for your site. Make sure that you provide all the necessary priviledge like create, delete, update.

Step 4: Import WordPress database on live site

The next step is to import your WordPress database. Go to your c-panel. There you find phpmyadmin. Click on it and you will find list of all the databases including the database that you have created in step 3. Click on that database. phpmyadmin will show you the database with no tables.

Click on the import tab on the top menu. On the import page, click on choose file button and then select the database file that you have created in step 1. See the image below

phpmyadmin-import-database

Step 5: Change the site URL

Now you need to change the site URL in your database, so that it will connect to your live WordPress site. In phpmyadmin, look for the wp_options table in your database that we just imported in step 4. If you changed your database prefix, then instead of wp_options it might be {prefix}_options.

Click on the browse button next to wp_options or the link that you see in the sidebar to open the page with a list fields within wp_options table. see the image below.

browse-wp-options

Under the field option_name you need to look for siteurl. Click the edit field icon which can be found at the far left at the beginning of the row. see the image below

siteurl

This field contains the value for example http://localhost/test. Change this value to https://www.webpagenation.com. In place of webpagenation you have to enter your domain name. If you are not using https then you have to enter http in place of https. Next you have to replicate the same procedure for the home field. Update the home url to the same URL as your siteurl.

Step 6: Set-up your website

At this time if you reload your site your site it would be showing Error establishing database connection. To fix this we have to edit wp-config.php file. Connect to your web-hosting account using an FTP client. Provide the database name, user and password you created in step 3. Save wp-config.php file and upload it. Reload your site and it should be live now.

Next login to your WordPress admin panel and go to Settings >> General. Without changing anything, scroll to the bottom and click the save changes button. This will ensure that the site URL is corrected anywhere else that it needs to be.

After that go to Settings >> Permalink and click save changes to ensure that all post links are fine.

Step 7: Fix Images and Broken links by Updating paths

Every time you move your WordPress site from local computer to live server you will face broken links and missing images.You can either use SQL plugin or Velvet Blues WordPress plugin. For those Who want to do this via SQL here is the SQL query

 UPDATE wp_posts SET post_content = REPLACE(post_content, 'localhost/test/', 'www.yourlivesite.com/'); 

Simply go to phpMyAdmin, click on your database and then click on SQL from top menu. Write this query, but don’t forget to change it with your own local site and live site URLs. see the image below

run-sql

That’s all for today. Stay tune for the next tutorial. If you have not subscribed for our weekly news-letter then please subscribe now by clicking the link below:

subscribe Button

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    If you like our content then please subscribe