Follow us:
Migrating your WordPress site from a local development environment (like Local WP, XAMPP, WAMP, Laragon, MAMP, etc.) to a live web host can feel daunting—but with this step-by-step approach, it’s smooth, safe, and even enjoyable. We’ll cover both plugin-assisted and manual methods, highlight common pitfalls, and explain why each action matters.
✅ Before You Start: What You’ll Need
- A ready-to-use live hosting account that meets WordPress requirements.
- A domain name pointed to your hosting account (via nameservers or A-record).
- Access to SFTP credentials or file manager for uploading files.
- A MySQL database or ability to create one (via cPanel, phpMyAdmin, etc.).
- A backup of your local site’s files and database.
🛠️ Method 1: Migrate Using the Duplicator Plugin (Easiest & Fastest)
Step 1: Prepare and Package Locally
Log into your local WordPress site.
Install and activate Duplicator (free version works for most sites).
Go to Duplicator → Packages, click Create New.

This brings you to a screen where you can give your backup a name.
Then, click the ‘Next’ button.

Let it scan your content—ideally all checks should show Good, with size notices acceptable.
Click Build, wait until it’s done.

Now download both:
The installer.php
script
The .zip
archive of your site

These files will lift and shift everything for you later.
Step 2: Upload to Your Live Host
Now, you need to upload the archive and installer files from your local site to your hosting account.
Connect to your live server via SFTP or file manager. Make sure that the root directory of your website is completely empty.
Normally, the root directory is the /home/public_html/
folder.
Some WordPress hosting companies automatically install WordPress when you sign up. If you have WordPress files there, then you need to delete them.
Upload the two Duplicator files to your empty root directory.

Step 3: Create a Clean Database
Before you can run the installer or upload the WordPress website from localhost to your hosting server, you need to create a MySQL database for your new live website.
If you have already created a MySQL database, then you can skip this step.
To create a database, you need to log in to your hosting control panel (e.g., cPanel). Then, locate the ‘Databases’ section and click on the ‘MySQL Database Wizard’ icon.

Provide a name for your database and click on the ‘Create Database’ button.

After that, you need to enter a username and password for your new user and then click the ‘Create User’ button.

Note down: DB_NAME, DB_USER, DB_PASSWORD, DB_HOST (often "localhost")
Assign all privileges to the new user.

Now, scroll down and click the ‘Make Changes’ button to save your changes.
Your database is now ready to be used with your WordPress site. Again, make sure to note down the database name, username, and password. You’ll need this information in the next step.
Step 4: Run the Duplicator Installer
Open your browser and visit: https://your-domain.com/installer.php
Don’t forget to replace ‘your-domain
’ with your own domain name.
This will launch the Duplicator migration wizard.
The installer will run a few tests and will initialize the script.

You will be asked to enter your MySQL host, database name, username, and password.
Your host will likely be a local host. After that, you will enter the details of the database you created in the earlier step.
Then, click on the ‘Validate’ button to make sure the details you entered are correct.

Now, click on the ‘Next’ button to continue.
Duplicator will now import your WordPress database backup from the archive into your new database.
It will also update URLs pointing to the local site and your new live site.
You can now click on the ‘Admin Login’ button to enter the WordPress admin area of your live site.

Once you log in to your live site, Duplicator will automatically clean up the installation files.
🎉 Voilà! Your site is now live.
🛠️ Method 2: Manual Migration (Greater Control)
Step 1: Export Your Local Database
Use phpMyAdmin to export your local WordPress database. Open phpMyAdmin or simply go to http://localhost/phpmyadmin/
and click on your WordPress database. Next, click on the ‘Export’ button from the top menu bar.

You can choose ‘Quick’ or ‘Custom.’ Custom will provide you with more options to export your database.
But we recommend selecting ‘Quick’ and then clicking the ‘Go’ button to download your database.

Step 2: Upload WordPress Files
Using FTP or file manager, upload all files and directories from your local install to your live directory. Make sure you upload the files in the right directory, normally it is public_html
directory.

Step 3: Create a MySQL Database on Your Live Site
To create a database, you need to log in to your hosting control panel (e.g., cPanel). Then, locate the ‘Databases’ section and click on the ‘MySQL Database Wizard’ icon.

Provide a name for your database and click on the ‘Create Database’ button.

After that, you need to enter a username and password for your new user and then click the ‘Create User’ button.

Note down: DB_NAME, DB_USER, DB_PASSWORD, DB_HOST (often "localhost")
Assign all privileges to the new user.

Now, scroll down and click the ‘Make Changes’ button to save your changes.
Step 4: Adjust wp-config.php
for Live DB
Using an FTP client or file manager, open up the wp-config.php
file.
You’ll be looking for the following lines of code:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );
/** MySQL database username */
define( 'DB_USER', 'username_here' );
/** MySQL database password */
define( 'DB_PASSWORD', 'password_here' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );
You will need to provide the database name, username, and password you created earlier.
Next, save the wp-config.php
file.
Step 5: Import Your Database
Go to your cPanel dashboard, scroll down to the ‘Databases’ section, and click on ‘phpMyAdmin.’

click on the database you just created above. phpMyAdmin will show your new database with no tables.
Next, click on the ‘Import’ tab in the top menu. On the import page, click on the ‘Choose File’ button and then select the database file from the local site you saved in the first step.

Now, click the ‘Go’ button at the bottom of the page. Your database will automatically be imported to phpMyadmin.
Step 6: Update URLs in Database
In phpMyAdmin, look for the wp_options
table in your database that you just imported above.
If you changed your database prefix, then instead of wp_options
, it might be {new_prefix}_options
.
Next, click on the ‘Browse’ button next to wp_options
. Or, click the link in the sidebar to open up the page that has a list of fields within the wp_options
table.

Then, in the options_name
column, you need to look for the siteurl
option.
Then, click the ‘Edit’ icon.

This brings up a window where you can edit the field.
In the input box option_value
, you’ll see the URL of your local install, which will be something like http://localhost/test
.
You need to insert your new site URL in this field, for example: https://wppassion.com
.
Then, you can save the field by clicking the ‘Go’ button.

Next, you need to follow the same steps as above for the home
option name. The wp_options
menu can be a few pages long. Usually, the home
option will be on the second page.
Then, update the home
URL, so it’s the same as your live site URL.
Step 7: Refresh Permalinks
Now, when you visit your website, it should be live.
Now, you need to log in to your WordPress admin panel and go to the Settings » General. Then, without changing anything, scroll to the bottom and click the ‘Save Changes’ button.

This will make sure that your site URL is corrected anywhere else that it needs to be.
Now, go to Settings » Permalinks, then scroll down and click ‘Save Changes’ to ensure that all post links are working fine.

Here’s the rewritten version for wppassion.com, keeping it descriptive, beginner-friendly, and structured for clarity:
Step 8: Fix Missing Images and Broken Links by Updating URLs
When you move your WordPress website from a local server to a live domain (or from one domain to another), you might notice that some images are missing or links are not working. That’s because the URLs in your database still point to the old address.
Don’t worry — we’ll show you two effective ways to update all your URLs so everything loads correctly on your live site.
✅ Method 1: Update URLs Using the “Search & Replace Everything” Plugin (Recommended)
This is the easiest and safest way for most users.
The Search & Replace Everything plugin allows you to update all old URLs in your WordPress database — no coding or complex SQL required.
Follow these steps:
Go to Plugins → Add New and search for Search & Replace Everything.
Install and activate the plugin.
Once activated, navigate to Tools → WP Search & Replace.

In the ‘Search for’ field, enter your old site URL (for example: http://localhost/test
).
In the ‘Replace with’ field, type your new live website URL (for example: https://www.yourlivesite.com
).
Scroll down and click ‘Select All’ under the tables list. This ensures the plugin will search every part of your database.

Click the ‘Preview Search & Replace’ button.
Review the preview results. If everything looks correct, click ‘Replace All’ to apply the changes.

A warning will appear asking for confirmation. Click ‘Yes’ to proceed.
That’s it! The plugin will go through your entire database and update all old URLs to the new live URL, fixing broken images and links.
🔧 Method 2: Manually Update URLs via SQL Query (Advanced Users Only)
If you’re comfortable working with databases, you can manually run an SQL query using phpMyAdmin.
Here’s how:
- Login to your hosting control panel and open phpMyAdmin.
- Select your WordPress database from the left-hand sidebar.
- Click on the SQL tab at the top.
- Paste the following SQL command, replacing the URLs with your own:
UPDATE wp_posts SET post_content = REPLACE(post_content, 'localhost/test/', 'www.yourlivesite.com/');
- Double-check the URLs you’ve entered, then click ‘Go’ to execute the query.

This command will search your post content for the old local URLs and replace them with your live site’s address.
Once you’ve completed either method, your website should display all images correctly, and internal links should point to the right pages.
Congratulations! 🎉 You’ve successfully migrated your WordPress site from your local server to a live environment.
🚦 Post-Migration Checklist
- ✅ Browse your site’s pages/posts—everything should display correctly.
- ✅ Check links, images, forms, and interactive features.
- ✅ Visit Dashboard → Settings → Reading, ensure “Discourage search engines” is OFF.
- ✅ Test media uploads via Media Library → Add New.
- ✅ Run a site speed test and consider setting up caching/CDN.
- ✅ Install a reliable backup plugin and configure scheduled backups.
📊 Which Method Should You Choose?
Migration Method | Ease of Use | Control Over Details | Best For |
---|---|---|---|
Duplicator Plugin | ✅ Very easy | ⚠️ Limited, but sufficient for most | Beginners → Intermediate |
Manual Migration | ⚠️ Needs careful setup | ✅ Full control | Advanced users or when plugin fails |
With this guide, your move from localhost to live WordPress is not just assured—it’s polished. Welcome to the exciting phase of having your site in production!