Making A WordPress Website Live From Localhost

Anuradha Kasaudhan
Pen | Bold Kiln Press
5 min readApr 28, 2018
This nice Photo is taken from: http://www.wpexplorer.com/

Building up a WordPress site on localhost is a brilliant method to accelerate the advancement procedure. In this article, I will demonstrate how to manually move WordPress Website from a localhost to a live site step by step.

Things you will need before starting this process

· Finished site in a local development environment and full access to it.

· A domain name and web hosting account with the provider of your choice.

·An FTP program and basic knowledge about using FTP and uploading content to the live site. A few examples of FTP are: FileZilla, WinSCP etc.

Step 1: Export Localhost Database from phpMyAdmin.

Go to http://localhost/phpmyadmin/ and click on localhost database. After doing it you will reach the following screen.

Open the localhost database located on the left side of the screen and then click on the Export button from the top menu bar.

Under the Export Method option, select ‘Quick’ or ‘Custom’. Select ‘Quick’ method, and then click the Go button to download your database. Selecting ‘Custom’ will give you more options to export your database.

Step 2: Upload localhost Files to Live Site through FTP

Open FTP client (fileZilla or WinSCP) and connect to web hosting account. Once connected to live site, make sure you upload the files in the right directory. For example, if you want the site to be hosted on www.wordpress.com, then you should upload all files in your public_html directory.

Now select localhost files and upload them to live server.

This may take a while.

Step 3: Create new MySQL Database for the Live Site

While FTP client is uploading localhost files to the server, you should start importing database to the live server. Hosting providers gives cPanel to manage the hosting of account, so create a database using cPanel. Login to cPanel dashboard and click on the MySQL Databases icon which can be found in the databases sections.

Redirect on the next screen, create a database by entering a name for website database and click on Create Database button.

After creating the database, scroll down to the MySQL Users section and add new user or an existing user to the database.

After adding the user, set MySQL privileges. Grant All Privileges to that user and make sure every checkbox is checked, and then click the Make Changes button.

Step 4: Import The Localhost Database to live database

Go to cPanel dashboard, scroll down to the databases section and click on phpMyAdmin.
phpMyAdmin shows previously created database. This database has no tables.
Click on the Import button from the top menu bar to import database. Click on Choose File button and then select the database file which saved previously.

Click on Go button which is at bottom of this page.
phpMyAdmin will now show imported database.

Step 5: Change the Site URL and home in database

Now you need to change the site URL and home in the database, so that it gets connected with the live WordPress site.
Click wp_options or browse to change siteurl and home.

Click on edit option to change siteurl and home which is something like this http://localhost/wordpress. Insert new siteurl and home value in these fields, for example: http://www.wordpress.com.
Save the field by click on Go button which is at bottom of this page.

Step 6: Configure wp-config.php on the Live Site

Connect with ftp and open wp-config.php and change database name, user and password which you created in the previous step. Save this file. Visit your website and you will see that your website is live now.
Login to WordPress admin panel through http://www.wordpess.com/admin and go to Settings » Permalink choose your preferred URL structure and save it to ensure all permalinks are updated.

Step 7: Updating Paths

Update path from this simple query:

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

Go to phpMyAdmin, click on database and then click on SQL from top menu bar. Write this query to update localhost to live site.

If you are looking for an expert help in app/web development and promotion, you’ve come to the right place. Feel free to contact us and send your questions! We are ready to start working with you today.
P.S. We have helped early stage startups and other big names including Uber, Bank of Baroda and a whole lot of others, building mobile, web applications.

--

--