Learn to Manually Move WordPress from Local Server to Live Site
Once you have finished customizing your website, transfer it from your computer to a server so that anybody can view it. Let us explore how to manually migrate your WordPress website from a local server to a live website.
Step 1: Exporting Local WordPress Database
First, use phpMyAdmin to export the local WordPress database.

Navigate to http://localhost/phpmyadmin/ and click on your WordPress database. Then, from the top menu bar click on the Export button.

In the Export option, select either “Quick” or “Custom”. With Custom, you will get more options for exporting your database.

It is recommended to select Quick, and then click the Go button. This will download your database.
Step 2: Uploading WordPress Files to Live Site
After your database is downloaded, you will need to move your website files to the live site.
To start with, open the FTP client and connect to your web hosting account.
Make sure the files are uploaded to the correct directory after you have established a connection to your live website. You must upload every file in your public_html directory, for instance, if you wish to host your website on yoursite.com.

Choose the local WordPress files and upload them to the live server.
Step 3: Creating MySQL Database on Live Site
While your WordPress files are being uploaded using the FTP client, begin importing your database onto the live server. The majority of WordPress hosting companies provide cPanel for hosting account management.
At first, log in to your cPanel dashboard and click on the MySQL Databases icon located in the Databases section.

Next, enter a name for your database to create new database and click on the Create Database button.

Once you create a database, go to the MySQL Users section and create a new user or add an existing user to the database.

The user’s MySQL rights will then be shown after that. Here, tick every box to give the user full access, then press the “Make Changes” button.
Step 4: Importing WordPress Database on Live Site
Now, you will need to import your WordPress database.
In the cPanel dashboard, go to the Databases section and click on phpMyAdmin.

After the phpMyAdmin dashboard gets displayed, click on the database you created in Step 3. This will show your new database without any tables.
In the top menu, click on the Import tab. Once the Import page gets displayed, click on Choose File button and then select the database file saved in Step 1.

Next, click the Go button at the bottom of the page. This will import your WordPress database.
Step 5: Changing the Site URL
You will need to change the site URL in your database for connecting with the live WordPress site.
In phpMyAdmin, search for the wp_options table in your database imported in Step 4. In case, you have changed your database prefix, then instead of wp_options, you will see it as {prefix}_options.

Next to wp_options click on the Browse button or the link in the sidebar to open the page with list of fields in the wp_options table as shown below:

Search for the siteurl under the option_name. Click on the Edit icon located at the far left at the start of the row.
The Edit field window will get displayed. You will see the URL of your local install such as: http://localhost/test in the input box for option_value. Insert your new site url in this field, for example: https://howto.idigitalcamp.com/blog.

Click on the Go button to save the changes.
Repeat this step for the option_name: home. Since the wp_options page is a few pages long, so just search for the name home. Generally, you will find it on the second page.
Update the home url similar to your siteurl.
Step 6: Setting up Your Live Site
After importing the database and uploading the content, you need to configure WordPress.
If you try browsing your site now, you will get an Error Establishing Database Connection error.
This can be fixed by connecting to your website using an FTP client and editing wp-config.php file.
Here you need to provide the database name, user and password created in Step 3.
Save the wp-config.php file and upload it back to your server.
Now visit your website, and it will be live now.
Next, login to your WordPress admin panel and go to Settings » General. Scroll to the bottom and click the Save Changes button.

With this, the site URL will get corrected anywhere else where it needs to be.
Next go to Settings » Permalink and click Save Changes to check that all post links are working fine.

Step 7: Fixing Images and Broken Links by Updating Paths
When you move a WordPress site from one domain to another, or from local server to a live site, there will be broken links and missing images.
You can use the SQL query or use the Velvet Blues WordPress plugin for fixing this issue.
If you want to do it via SQL, use the below simple SQL query:
UPDATE wp_posts SET post_content = REPLACE(post_content, ‘localhost/test/’, ‘www.yourlivesite.com/’);
Go to phpMyAdmin, click on your database and then click on SQL from the top menu. Use this query, but replace it with your own local site and live site URLs.

That’s it, you have migrated WordPress from local server to a live site successfully!
Hope that now your live website is up and running smoothly. Browse your website and make sure that everything is working as expected. In case there are any errors, go though this guide to common WordPress errors for help troubleshooting.