How to move WordPress local to live server?

Introduction

Before starting development you have to install in your personal computer (PC) WAMP for Windows, MAMP for Mac and LAMP for Linux. Once you finished the installation. Now you have to install in WordPress in your local computer it is smart way to speed up the development in your local computer.  Once you finished perfecting your website on your local computer. Next step is the move site in live server.  In this article I will guide you how to move WordPress site local to live Server manually.

Step 1– Export your local database
First you need export your WordPress database from your local phpMyAdmin. Simply use / hit this url http://localhost/phpmyadmin/ select your WordPress database and click on Export tab. Please see this screenshot 1 highlighted button.

Screenshot 1

After that, see the screenshot 2 for export database please click on Go button.

Screenshot 2

Step 2- Upload your projects local files in live site.

In this steps please upload your all local files in live site using FTP or SFTP client software (Filezilla, winSCP etc.) to connect and upload files in domain directory public_html folder.

Step 3- Create MySql database in live site.

Please create the database in your live site and please click on import button see screenshot 3.

Screenshot 3

After that click on choose file button and select the local database file and click on highlighted Go button please see screenshot 4

Screenshot 4

After that imported database please open your database and choose “{prefix}_options” table please see below screenshot 7 highlighted table prefix you can change according to your project.

Screenshot 7

After that please replace your local url to live site siteurl and home. Please see below screenshot 8

Screenshot 8

After that you have to replace all local site posts, pages and media broken link change to live url please see below update sql queries.
UPDATE {prefix}_posts SET post_content = REPLACE(post_content, 'localhost/yourlocalsite/', 'www.yourlivesite.com/');

Screenshot 9

Or you use WP Migrate DB exports your database as a MySQL data dump (much like phpMyAdmin), does a find and replace on URLs and file paths, handles serialized data, then allows you to save it to your computer as an SQL file. To complete the migration, you need to use a database management tool (e.g. phpMyAdmin) to import the SQL file to your database, replacing your existing database. It is perfect for developers who need to migrate fresh data from the production site to their local install, or migrate their locally developed site to a staging or production server. For more details please see below screenshot 5.
Download the WP Migrate DB from WordPress plugins. Extract/unzip the downloaded zip file copy the unzip folder and paste your project/wp-content/plugins folder in your local computer site after that login with admin credential and go to admin dashboard choose plugins and click activate button on WP Migrate DB. Please see below screenshot 5

Screenshot 5

After activating WP Migrate DB plugin please choose “Tools” submenu “WP migrate DB” menu. Below screenshot 6 please set your replace input URL and file path.

Screenshot 6

Downloaded file sql file please create database in your live site and import this sql without any changes database.

Step 4- wp-config.php setting.

Open your live site wp-config.php and edit local site database name to your live site database name, local site database username to live site database username, local site database password to live site database password and edit your local site hostname to live site hostname. Please see below screenshot 10 highlighted options.

Screenshot 10

Define your unique keys for security.

Screenshot 11

Define/edit your database table prefix local site to live site (optional).

WordPress local site to live site hosting completed.
Thank you.

Leave a comment

Blog at WordPress.com.

Up ↑