Migration Overview

To take a WordPress site you built locally (with XAMPP) online, you need to move two things: the files (theme, plugins, images and the WordPress core) and the database (posts, settings, users). In this article we explain step by step how to do the migration manually, without a plugin. The process may look technical at first, but if you follow the steps in order it will finish smoothly.

Before you start, make sure you have a hosting account on a live server, a domain name and access to your hosting panel (cPanel). Also download an FTP program (FileZilla is recommended).

Step 1: Export the Local Database

  • Make sure MySQL is running in XAMPP.
  • Go to http://localhost/phpmyadmin.
  • Select your site's database on the left.
  • Click the Export tab in the top menu.
  • Choose the "Quick" method and the SQL format, then click the Go button.

A .sql file will download to your computer. This file contains all of your content; keep it safe.

Step 2: Prepare the Local Files

You will move all the files in your C:\xampp\htdocs\yoursite folder. If you like, you can ZIP the entire folder into a single file; this speeds up the upload.

Step 3: Create a Database on the Live Server

In cPanel, go to the MySQL Databases section. Create a new database and a new user, then add the user to the database with all privileges. Note down the database name, username and password; these will be different from the local ones.

Step 4: Import the Database

  • Open phpMyAdmin from cPanel.
  • Select the empty database you just created.
  • Click the Import tab.
  • Choose the .sql file you downloaded in the previous step and click Go.

When the process is complete, all the tables from your local site will have been copied to the live database.

Step 5: Upload the Files via FTP

Open FileZilla and connect with your hosting details (server address, FTP username, password). Drag your local files into the public_html directory in the right panel to upload them. Since there are many files, this step may take a while depending on your internet speed.

Step 6: Update the wp-config.php File

Open the wp-config.php file on the server (via the cPanel File Manager or FTP). Replace the local database details with the details of the live server:

define('DB_NAME', 'live_database_name');
define('DB_USER', 'live_user_name');
define('DB_PASSWORD', 'live_password');
define('DB_HOST', 'localhost');

If you skip this step you will run into the "Error establishing a database connection" message.

Step 7: Update the Site Addresses (URLs)

All the addresses in your database are still saved as http://localhost/yoursite. You need to replace them with your new domain name. The safest method is to use the "Better Search Replace" plugin; but if you can't get into the dashboard yet, make two quick fixes from phpMyAdmin:

In the wp_options table, replace the http://localhost/yoursite value in the siteurl and home fields with https://www.yoursite.com. This lets you log in to the dashboard. Then, from the dashboard, use the Better Search Replace plugin to scan and update all the old addresses in your content.

Step 8: Checks and Final Settings

Open your site in the browser and check that everything is in place. Then do these final steps: open Settings > Permalinks and save without changing anything (this refreshes the links and prevents 404 errors); enable your SSL certificate; and finally, add your site to Google Search Console and submit your sitemap.

Automatic Migration with a Plugin (the Easy Way)

For those who find the manual migration process technical, plugins offer great convenience. All-in-One WP Migration is one of the most popular options: it exports your local site into a single file with one click, then you install the same plugin on the live site and import that file. The plugin handles the files, the database and the URL changes for you. Duplicator, on the other hand, prepares the site as a "package" and an "installer" file; this method is especially preferred for large sites. The plugin method is recommended for beginners because it automates error-prone steps such as URL updates and database transfer. Even so, knowing the manual method helps you understand the problem when something goes wrong.

Post-Migration SEO Checklist

Once the site is live, a few checks are essential for your search engine visibility. First, make sure the "Discourage search engines from indexing this site" box on the Settings > Reading page in WordPress is unchecked; this box may have been left checked out of local development habit and can cause your site to never appear on Google. Then add your site to Google Search Console, submit your sitemap and check your robots.txt file. Verify that all internal and external links point to the https version. These checks ensure that the site you migrated gets indexed smoothly.

Performance and Cache Settings

Unlike a local environment, the live environment serves real visitors; that is why performance settings become important. Once the migration is complete, I recommend installing a cache plugin; tools like WP Super Cache or LiteSpeed Cache store pages statically and noticeably reduce load times. Add a plugin that compresses images and, if possible, use a CDN (content delivery network). Finally, make sure you have selected an up-to-date version of PHP (at least PHP 8.x) from your hosting panel. These settings positively affect both the visitor experience and search engine ranking.

Frequently Asked Questions (FAQ)

Why do I need to change the local URLs during migration?

WordPress stores the site address in the database as http://localhost/yoursite. If these addresses aren't updated, the links, images and redirects on the live site will point to localhost and the site won't work correctly. That is why you need to change the siteurl and home values, and then all the old addresses in your content, to your new domain name.

Is a plugin or the manual method better for migration?

For beginners, plugins like All-in-One WP Migration or Duplicator are safer because they automate error-prone steps such as URL updates and database transfer. Still, knowing the manual method lets you understand and step in when something goes wrong.

My migrated site doesn't appear on Google, why?

The most common reason is leaving the "Discourage search engines from indexing this site" box on the Settings > Reading page checked. This box may have stayed checked out of local development habit. Uncheck the box, then add the site to Google Search Console and submit your sitemap.

Conclusion

Migrating a local WordPress site to live is simply a matter of transferring the files and the database in the correct order and updating wp-config.php and the URLs. If you follow the steps in order and don't skip the SEO and performance checks after migration, your site will go live without issues. If you want to automate the work, migration plugins make the process significantly easier.

Related Articles