[![How to Move WordPress from a Local Server to a Live Website 1](https://coma.lv/wp-content/uploads/2024/09/Gemini_Generated_Image_pbfhg8pbfhg8pbfh-2000px.webp)](https://coma.lv/wp-content/uploads/2024/09/Gemini_Generated_Image_pbfhg8pbfhg8pbfh-2000px-1030x396.webp)

# How to Move WordPress from a Local Server to a Live Website

Sep 7, 2024/by [Alina](https://coma.lv/en/author/alina-suhorukova-gmail-com/)

Using a local server can speed up WordPress site development. We have already shown you how to [install WordPress on Windows using WAMP](https://coma.lv/en/2024/08/22/how-to-install-wordpress-on-your-pc-using-wamp/) and on Mac using MAMP. When you have finished developing on the local server, the next step is to take the site online. In this article we will show you how to move WordPress from a local server to the internet. Using this method, you can migrate all of your content (posts, pages, images and so on), themes and plugins from the local server to a live website.

Before we begin, we have to admit that plugins such as [All-in-One WP Migration](https://wordpress.org/plugins/all-in-one-wp-migration/), [WPvivid Backup](https://wordpress.org/plugins/wpvivid-backuprestore/) and [Duplicator](https://wordpress.org/plugins/duplicator/) can make a migration from a local server much easier. In this article we will show how to move WordPress from a local server manually so that you can understand the whole process.

## Before You Start

To migrate your locally developed WordPress site to an online server, you need two things. The first is a local server. We assume that you use WordPress on a local server and have full access to it. The second is web hosting that supports WordPress, to which you will move your content.

You also need an FTP program and need to know how to use it to upload your content to the live site.

Note: the screenshots in our article were taken on hosting providers that have cPanel.

## Step 1: Export the Local WordPress Database

First you need to export your local WordPress database. To do this we will use phpMyAdmin. If you are not familiar with it, you can read [our guide on how to manage a WordPress database using phpMyAdmin](https://coma.lv/en/2025/07/16/managing-a-wordpress-database-with-phpmyadmin-a-beginners-guide/). Just go to http://localhost/phpmyadmin/ and click your WordPress database. Then click the *Export* button in the top menu.

![export-tab-phpmyadmin](https://coma.lv/wp-content/uploads/2016/09/export-tab-phpmyadmin.jpeg)

For the *Export Method*, choose the custom option, which gives you more export options. Select all tables for export and gzipped for compression. Scroll to the bottom of the page and click the *Go* button to download your database.

## Step 2: Upload the WordPress Files to the Website

Now open your FTP client and connect to your site. Once connected, make sure you upload the files to the right directory. For example, if you want to host your site at yoursite.com, you should upload all the files to the public_html directory.

![uploadingwordpress](https://coma.lv/wp-content/uploads/2016/09/uploadingwordpress.jpg)

Now select your local WordPress files and upload them to the live server.

## Step 3: Create a MySQL Database on the Website

While your FTP client is uploading the WordPress files, you can import your database to the live server. Most WordPress hosting providers offer cPanel for managing your hosting account, so we will show how to create a database using cPanel. Log in to cPanel and click the Manage My Databases link in the databases section.

![createdatabasecpanel](https://coma.lv/wp-content/uploads/2025/07/Ekranuznemums-2025-07-03-041014.jpg)

In the next window, enter the name of your new database.

![createnewdb](https://coma.lv/wp-content/uploads/2025/07/Ekranuznemums-2025-07-03-042154.jpg)

After creating the database, scroll down to the Database Users section and create a user or add an existing user to the database. After that cPanel will show you a list of MySQL privileges for this user. Just select all privileges.

![newdbuser](https://coma.lv/wp-content/uploads/2025/07/Ekranuznemums-2025-07-03-042652.jpg)

## Step 4: Import the WordPress Database to the Website

The next step in the process is importing the WordPress database. Go to cPanel, scroll down to the databases section and click phpMyAdmin. This takes you to phpMyAdmin, where you need to click the database you have just created. phpMyAdmin will show you the new database with no tables. Click the *Import* tab in the top menu. On the next page click the “choose file” button and then select the gzipped database file you saved earlier. Finally, click the *Go* button at the bottom of the page. phpMyAdmin will now import your WordPress database.

![importingdb2](https://coma.lv/wp-content/uploads/2016/09/importingdb2.jpg)

## Step 5: Change the URL

To set up your site online, you need to change its URL. In phpMyAdmin, find the wp_options table in the database we have just imported. If you changed your database prefix, it may be {prefix}_options instead of wp_options.

Click the “browse” button next to wp_options or the link in the sidebar to open the page listing the fields in the wp_options table.

![wpoptionsbrowse](https://coma.lv/wp-content/uploads/2016/09/wpoptionsbrowse.jpg)

Under the **options_name** field you need to find **siteurl**. Click the *Edit Field* icon at the start of the row on the left.

![editsiteurlphpmyadmin](https://coma.lv/wp-content/uploads/2016/09/editsiteurlphpmyadmin.jpg)

When you click *Edit Field*, a new window appears. In the input field for option_value you will see the URL of your local installation, which will look something like this: http://localhost/test. Carefully enter your new URL in this field, for example: https://coma.lv/

Save the changes by clicking the *Go* button.

Next you need to repeat this step for the **home** option. Update the **home** URL – it must be identical to your **siteurl**.

## Step 6: Configure Your Website

Now that you have imported the database and all of your content is uploaded, it is time to configure WordPress. At this point your site should show a [database connection error](https://coma.lv/en/2024/08/21/error-establishing-a-database-connection-in-wordpress-how-to-fix-it-in-5-minutes/). To fix it, connect to your site with an FTP client and edit the wp-config.php file. Enter the name of the database, the user and the password you created earlier. Save the wp-config.php file and upload it back to your server. Go to your site – everything should work now.

Log in to the WordPress admin panel and choose **Settings > General**. Click *Save Options*. This will update the site URL everywhere it is needed.

Then go to **Settings > Permalinks** and click *Save* to make sure all links work properly.

## Step 7: Update Paths to Fix Broken Links and Images

When you migrate WordPress from one domain to another, or from a local server to a live website, you will run into broken links and images. In that case you can use an SQL query or the [Better Search Replace](https://wordpress.org/plugins/better-search-replace/) plugin for WordPress.

If you want to use SQL, here is a simple SQL query that should fix the problem:

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

Go to phpMyAdmin, click your database and then SQL in the top menu. Enter this query, but do not forget to insert your own local and live site URLs.

![wpfiximageurls](https://coma.lv/wp-content/uploads/2016/09/wpfiximageurls.jpg)

## Extra: Security and SEO

- Make sure the site runs on HTTPS.
- Install a security plugin (for example, [Wordfence](https://wordpress.org/plugins/wordfence/) or [Solid Security](https://wordpress.org/plugins/better-wp-security/)).
- Connect the site to Google Search Console and submit a sitemap.
- Remove unneeded test plugins or themes left over from local development.

That’s it. We hope your site is now ready to go. Check your site and make sure everything works exactly the way you want. Feel free to leave your comments under this post if you have any difficulties or questions, and we will try to help you.

If you move sites regularly, use automated solutions such as WPvivid or All-in-One WP Migration. This will save you a lot of time and keep errors to a minimum.

---

*Our specialization is WordPress website development and maintenance. Contact us for a free consultation — [vadim@coma.lv](mailto:vadim@coma.lv), [+371 29394520](tel:+37129394520)*

---
