Skip to content
CodeAstrology
Working Hours 9:30 am - 6:30 pm (Sun - Thu)
Contact Us contact@codeastrology.com
CodeAstrology

CodeAstrology

We Develop and Sell WordPress Plugins and Themes

  • Home
  • About
    • Services
    • Company
    • Team
  • Products
    • Premium Products
    • Woo Product Table
    • Min Max Quantity & Step Control
    • UltraAddons
    • Pricing – Add to cart button Changer
  • Blog
  • Contact
  • My Account
    • Support Area
    • Affiliate Area
 0 - $0.00
Get Quote
Upload WP Website from Localhost to Server
By Tanzilal Mugdho

How to Upload WordPress Website from Localhost to Server (in 7 Steps)

Seriously, how to upload wordpress website from localhost to server? While we often use a local server to customize websites or use coding for development purposes, many of us don’t know the appropriate method. A local server is used on a regular basis to work privately on websites. But do you know?

-Your site won’t be visible to the users when it remains on the local server

Yes, that’s right. So, you can’t always keep your website on the local server. You have to move your site to the live server eventually. This will allow online visitors to use or visit your website. Therefore, you need to upload WordPress website from localhost to server once you think your site is ready to show the world.

Keeping that in mind, we decided to show you how to upload WordPress website from localhost to server in this article. Let’s start!

Table of Contents

  • Why Is It Important to Move WordPress Website from Localhost to Live Server
  • Woo Product Table Pro
      • The Most Popular Product Table Plugin For WooCommerce
  • Manually Upload WordPress Website from Localhost to Server in 7 Steps
    • Step 1: Export the Database of the Local WordPress
    • Step 2: Upload WordPress Files to Live Server
    • Step 3: Create MySQL Database on The Main Server
    • Step 4: Import The Database to The Live Server
    • Step 5: Change the Website’s URL
    • Step 6: Configure Your Live Website
    • Step 7: Update Paths to Fix Broken Links and Images
  • What’s Next After Uploading WordPress Website from Localhost to Server?

Why Is It Important to Move WordPress Website from Localhost to Live Server

Changing or moderating your website on a local server is a common method. When some parts of your website are still under development and you don’t want to show it to the visitors, you can keep your site on the local server.

Once you have finished the modification and are determined to show it online, then you must transfer it to the live server.

special offer for code astrology

Woo Product Table Pro

The Most Popular Product Table Plugin For WooCommerce

Get Special Discount

Manually Upload WordPress Website from Localhost to Server in 7 Steps

We are going to demonstrate the manual process of uploading a WordPress website from localhost to a live server in just 7 steps. We expect your full attention on this.

Our method is preferable for those who like to do things manually. If you want to upload WordPress website from localhost to server manually, then this method is for you. Let’s begin.

Step 1: Export the Database of the Local WordPress

The first thing to do in manually transporting your WordPress site from localhost to the live server is to export the local WordPress database using the phpMyAdmin. Before that, make sure you know how to access the local server. You can also ask your hosting provider for assistance.

Once you are inside the local server, go to –

http://localhost/phpmyadmin/

Select the WordPress database and then, click the ‘Export’ button from the top menu bar.

Export database

There are 2 options to export the database – ‘Quick’ and ‘Custom’. Although the ‘Custom’ option will give you more options for exporting the database, we suggest using the ‘Quick’ option as it is more convenient and time-consuming. 
After selecting the export option, just click the ‘Go’ button to download your database.

Table export options

Step 2: Upload WordPress Files to Live Server

Once you are done with the database export, you need to move WordPress files from the local server to the live server. You can either use an FTP server or cPanel for this. And if you don’t have access to these, you should immediately contact your hosting provider.

When you connect to either the FTP server or cPanel, head towards the subfolder location and download all the necessary WordPress files to your computer.

Download database

After that, locate the public_html folder and open it, which can be found inside the root domain.

Please Note:

The public_html folder can be named as ‘www’ or after your domain name. It depends on the hosting environment.

In this folder, upload all the files that you have downloaded earlier from the root directory.

Upload database

Step 3: Create MySQL Database on The Main Server

You can either create a new MySQL database for your WordPress site or import one to the live server. Your hosting provider should be giving you cPanel access. You can create a MySQL database easily by using the cPanel.

On the other hand, you can start importing the database from the local server to the main server while your FTP client is still uploading WordPress files. 

In order to create a database in the live server, log in to the cPanel. Under the cPanel dashboard, go to the ‘Database’ section and select the “MySQL Database Wizard” icon.

mysql database wizard

This will bring the next screen where you need to provide a name for the database. Once you give a name to your database, click the “Create Database” button. This will automatically generate a new MySQL database for you.

create a database

Creating a new database will require a new user. So, you have to provide a username and password in the next tab. After that, click on “Create User”.

create database users

Once the user is created, you need to add the user to the database and check the “All Privileges” option to give him full control over the database.

Give all privileges

After that, you should click the “Make Changes” to save your changes. This way, you can create a MySQL database for the live server.

Step 4: Import The Database to The Live Server

In this step, you will need to import the database to the live server that you have created in Step 3. To start the process, you should go to –

cPanel dashboard >> Databases >> Click on “phpMyAdmin”

select phpmyadmin

Clicking the phpMyAdmin will take you to the database that you just created. The new database will have no tables. After that, select the ‘Import’ tab on the top right corner of the menu bar.

Once the ‘Import’ tab is opened, click on the “Choose File” button. This will give you the option to upload the database from your local storage that you have created earlier.

Import database

Next, hit the ‘Go’ button at the bottom of the page and the phpMyadmin will begin to import the database automatically. 

Also Learn –

3 Ways to Fix the Error While Establishing a Database Connection in WordPress

Step 5: Change the Website’s URL

Once you have successfully created and imported a MySQL database, you have to change the URL of your WordPress site. The process starts with changing the URL in the database so that it can connect with the live website.

Search for the wp_options table inside the database (under phpMyAdmin) that you just imported in the earlier step.

Note:

If you have changed the prefix of the database, then you may look for the {new_prefix}_options instead of wp_options.

Okay! Next to the wp_options, you will see a ‘Browse’ button. Click on the button to open the list of fields that are inside the wp_options table.

wp_options to browse

Look for the siteurl option inside the options_name column and hit the ‘Edit’ icon to open the corresponding window to edit this field.

edit siteurl

In the input field next to the option_value, you will find the URL of your local server, which can be something like –

http://localhost/test

Alter this link with the URL of your live server, for example –

http://codeastrology.com/

Next, click the ‘Go’ button to save the changes.

change option value

After that, you have to follow the same procedure to change the home option name. The wp_options menu can be a few pages long and you can find the home option on the second page.

In the same way, update the home URL in accordance with your live site.

Step 6: Configure Your Live Website

Now that you have finished importing necessary files, databases, and changed the website’s URL; it is time to set up your WordPress site. You will notice your website is showing an error message like the below –

 “Error establishing a database connection”

So, how do we fix this? Well, connect to your FTP client and look for the wp-config.php file. Open the file and look for the following lines of code –

// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define( ‘DB_NAME’, ‘database_name_here’ );
/** MySQL database username */
define( ‘DB_USER’, ‘username_here’ );
/** MySQL database password */
define( ‘DB_PASSWORD’, ‘password_here’ );
/** MySQL hostname */
define( ‘DB_HOST’, ‘localhost’ );

Here, provide your database name, user name, and password in the following way –

  • ‘database_name_here’ → Give the name of your database that you have created earlier
  • ‘username_here’ → Give the username
  • ‘password_here’ → Give the password

After providing the credentials accordingly, save the wp-config.php file and upload it to the WordPress hosting server.

Now you will find your WordPress site on the live server.

But the work is not done, there are some configurations in the WordPress admin panel. Go to –

Settings » General

Don’t change anything now. Scroll down at the bottom of the page and hit the “Save Changes” button. This will allow your WordPress website to accept the new URL and apply the same policy in all other cases where it needs to be done.

General settings

Once you are sure that everything is ok, go to –

Settings » Permalinks

Similarly, don’t change anything here. Just scroll down at the bottom and click the “Save Changes” button to make sure all the post links are working fine.

Save permalinks
You might be interested in –

The Ultimate Trick To Add a Password Protected Post or Page

Step 7: Update Paths to Fix Broken Links and Images

No matter how smoothly you move a WordPress site from the local host to the live server, you will get some broken links and miss some images.

Luckily, updating the broken links can be done easily. To do this, click on the database after going to phpMyAdmin. Click on the SQL tab on the top menu bar and the following SQL query  

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

Make sure you have changed the above SQL in the following way –

  • ‘localhost/test/’ → You should insert your local URL
  • ‘www.yourlivesite.com/’ → You should insert your live URL

Click the ‘Go’ button to save the changes.

SQL go button

What’s Next After Uploading WordPress Website from Localhost to Server?

No matter which method you have chosen, it will get the job done. Moving a WordPress site from a local server to a live server is not that difficult, we are sure you feel the same after reading this article.

At the end of this discussion, we would like to suggest checking everything thoroughly after uploading your website to localhost to the live server. Make sure you have the necessary backup of the entire website. Because if something goes wrong in the local server and if you accidentally upload it to the live server, you may need to roll back. So, you should have an automated backup system for your website. On top of that, it is wise to take a manual backup of your website and database when you are working on something critical and big.

Localhost to Server Tips and Tricks WordPress

Share

Post navigation

Previous: How to Get a WordPress Internship Remote
Next: WordPress Zoom Integration | The Top 5 Plugins in 2022

Free Download

Woo Product Table (Free Version)

Checkout Added to cart

Min Max Quantity & Step Control (Free)

Checkout Added to cart

UltraAddons Elementor (Free)

Checkout Added to cart

Premium Plugins

Woo Product Table Pro

  • Billed once per year until cancelled

  • Billed once per year until cancelled

  • Billed once per year until cancelled

Checkout Added to cart

Min Max Step Control Pro

  • Billed once per year until cancelled

  • Billed once per year until cancelled

  • Billed once per year until cancelled

Checkout Added to cart

Recent Posts

  • Common Mistakes in Software Development and Ways to Avoid Them
  • Top five WordPress Page Builders
  • What is a Woo Product Table?
  • The 7 Principles of Conversion-Centered Landing Page Design
  • Potential analysis of social media channels in relation to the success of customer retention
  • How To Fix Common SSL Issues in WordPress
  • 12 Tips to Create a WordPress Blog
  • Why don’t WordPress Posts not showing on mobile
  • How to Prevent a 504 Gateway Timeout in WordPress
  • How to login into a WordPress site using the phone number
  • How to Show Widgets on Specific Pages in WordPress
  • How do I Fix Mobile Menu in WordPress?
  • How to Delete WordPress Site from Host gator

Categories

  • Advanced Custom Fields
  • Advanced Search
  • Business Idea
  • Custom Fields WooCommerce
  • Custom Taxonomy
  • E-Commerce
  • Errors
  • Featured Tutorial
  • Instant Search
  • Min Mx
  • Multiple Product to Cart
  • News
  • Online Business
  • Personal
  • PHP
  • Plugin
  • Product Variation
  • Programming
  • Quick Buy
  • Theme
  • Tips and Tricks
  • Uncategorized
  • Woo Product Table pro
  • WooCommerce
  • WooCommerce Filter
  • WooCommerce Product Table
  • WooCommerce Product Table Free
  • Wordpress
Trustpilot

Subscribe to our Newsletter

Resources

  • Support
  • Coupons
  • Blog & News
  • Write For Us
  • Video Tutorials
  • Affiliate Program

Company

  • Our Service
  • Get Quote
  • Refund Policy
  • Privacy Policy
  • Support Policy
  • Terms of Service

Powered By

© 2022, CodeAstrology. All Rights Reserved.
  • Privacy Policy
  • Terms of Service
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT