How to Move WordPress From Local Server to Live Site (2 Ways)

How to Move WordPress from Local Server to Live Site (2023 Guide)

Developing a WordPress website locally on your own computer before moving it to a live web server is a smart choice for many reasons:

  • It‘s private – you can design, experiment and test out your site before revealing it to the world
  • It‘s safe – if something breaks, your live site won‘t be affected
  • It‘s fast – everything runs quicker on your local machine vs a remote server
  • It‘s convenient – you can work on your site anytime without needing an internet connection

However, once you‘ve got your local WordPress site polished and ready to launch, you need to migrate it to a live web hosting server to make it available to the public. This process intimidates a lot of WordPress users, but it doesn‘t have to be complicated.

In this step-by-step guide, we‘ll show you exactly how to move WordPress from a local server to a live site. We‘ll cover two methods:

  1. The easy way using a plugin (recommended for beginners)
  2. The manual way (more advanced but good to learn)

Let‘s dive in! Feel free to use the quick links below to jump to the section you need:

  • Prerequisites Before Moving WordPress
  • Method 1: Easy Migration with Duplicator Plugin
  • Method 2: Manual WordPress Migration
  • Post-Migration Steps
  • Troubleshooting & FAQs

Prerequisites Before Moving WordPress
Before you can migrate your local WordPress site to a live server, you need to have a few things ready:

  1. A domain name – this will be your website‘s address on the internet (e.g. www.yoursite.com). You can register a domain through a domain registrar or often through your web hosting company.

  2. A web hosting account – this is where your WordPress site‘s files and database will actually be stored and served to visitors. For a standard WordPress site, we recommend going with a reputable shared hosting provider like:

  • Bluehost: Starting at $2.75/month with a free domain name included
  • Hostinger: Plans from $1.99/month with 24/7 support
  • SiteGround: Essentially managed WordPress hosting features for as little as $4.99/month

All of these hosts have quick 1-click WordPress installs and give you the needed tools to get your site running smoothly (cPanel, database access, FTP, etc.)

  1. An empty directory for WordPress on your live server – Make sure the directory you want to install WordPress is totally empty. If your host automatically installed WordPress for you already, clear out those files first.

  2. A complete local WordPress site ready to go! Ensure your local site is set up exactly as you want it and tested thoroughly. Moving to a live server should be the very last step.

Now let‘s look at how to actually do the migration. Here are the two main methods, starting with the easier one:

Method 1: Easy WordPress Migration Using Duplicator Plugin
By far the simplest way to move a local WordPress site to a live server is using the free Duplicator plugin. It automates the process of dumping your database, packaging up your files, and then deploying it all to the new location.

Here‘s how to migrate WordPress using Duplicator in a few steps:

Step 1: Install and activate the free Duplicator plugin on your local WordPress site. You can download it from the WordPress.org plugin directory or by searching for "Duplicator" under Plugins → Add New in your local WordPress dashboard.

Step 2: Once activated, go to the Duplicator menu in your WordPress admin sidebar and click the "Packages" button.

Step 3: Click the "Create New" button and give your package a name. Just use something simple like "Live Migration." Then click "Next."

Step 4: Duplicator will run some checks on your site and generate the package files. Once complete, click the "One-Click Download" button to download both the Installer and the Archive package files.

The Archive file is a complete copy of your local WordPress files and database dumped into a single .zip file. The Installer is a special .php file that will automate the process of extracting the Archive file and moving the site.

Step 5: Upload both the Installer.php file and the Archive.zip file to the directory on your live server where you want WordPress installed using FTP or cPanel‘s File Manager.

Step 6: Create a MySQL database for your live WordPress site using cPanel or your host‘s database manager tool. Make note of the database name and user credentials.

Step 7: Visit the Installer.php file in a browser by going to yourdomain.com/installer.php (replace yourdomain.com with your actual domain name).

Step 8: The Duplicator installer will run. First, it will ask you to enter your MySQL host, database name, username and password for the new database you created in Step 6. Enter them and click the "Test Database" button to verify the connection.

Step 9: Once the database connection is successful, check the box labeled "I have read and accept all terms & notices" and click "Next."

Duplicator will now extract the Archive file, import your WordPress database, and update your siteurl and home URL settings to match your new domain. Let it run until you see "Migration Complete!"

Step 10: Click the "Admin Login" button and login to your newly migrated live WordPress site to make sure everything looks good. Duplicator will automatically clean up the installer files.

That‘s it! Your local WordPress site should now be fully migrated to your live server and ready for the world to see. Duplicator makes the whole process very straightforward.

Method 2: Manually Migrate WordPress to Live Server
If you prefer to get your hands dirty, you can also migrate WordPress to a live site manually. This is a bit more technical but it‘s a good process to learn. Here‘s how:

Step 1: Export your WordPress database using phpMyAdmin on your local site. Select your local WordPress database and click "Export." Choose "Quick" as the Export Method and click "Go." This will download a database dump .sql file.

Step 2: Use FTP or your host‘s file manager to upload your entire local WordPress site‘s files (everything in the local WordPress directory) to the desired location on your live server.

Step 3: Create a new MySQL database for your live site using cPanel or your host‘s database tool, making note of the database name, username and password. You can call it whatever you want.

Step 4: Edit the wp-config.php file in the WordPress files you just uploaded to your live server. You need to update the database connection info in that file to match the new database you created in Step 3.

Find these lines in wp-config.php:

define(‘DB_NAME‘, ‘local_db‘);
define(‘DB_USER‘, ‘root‘);
define(‘DB_PASSWORD‘, ‘‘);
define(‘DB_HOST‘, ‘localhost‘);

And replace the values in the single quotes with your new database name, user, password, and host (host will usually be localhost on most shared servers).

Step 5: Upload the edited wp-config.php file back to your server, overwriting the old one.

Step 6: Import the .sql file you exported in Step 1 to your new database using phpMyAdmin or cPanel on your live server. This should populate the new database with your WordPress site‘s content.

Step 7: Update the site URL and home URL in your new WordPress database. In phpMyAdmin, find the wp_options table of your database. Find the siteurl and home rows and click "Edit" for each.

Update the option_value field for each to be your new domain URL. So if your local install was at http://localhost/mysite, you would change both to http://www.yournewdomain.com.

Save both rows and you should now be able to load up the site on your live domain! But you‘re not quite done yet…

Post-Migration Steps
After migrating your WordPress site to the live server, it‘s important to tie up some loose ends:

  1. Verify your site loads properly on the new domain. Make sure there are no glaring issues or errors. Test your pages and functionality thoroughly.

  2. Login to your new site‘s WordPress admin dashboard. Go to Settings → Permalinks and click "Save Changes" to flush rewrite rules and ensure all links are updated. Do this even if you don‘t make any actual changes.

  3. Double check your site URL under Settings → General. Make sure it wasn‘t overwritten with the development URL. Update it to the new domain if needed.

  4. Fix broken images and internal links. Your site likely has many instances of the old local site URL in the content, such as images and internal links. To update these, you can use a tool like Better Search Replace or run a SQL find and replace query on your database.

For example, in phpMyAdmin, click your database and go to the SQL tab. Run this query to update all instances of the old URL to the new one:

UPDATE wp_posts SET post_content = REPLACE(post_content, ‘http://localhost/mysite‘, ‘http://www.yournewdomain.com‘);

Just replace the two URLs with your old local one and new live one.

Your WordPress site should now be fully migrated and functional on its new domain! Make sure to delete the local site files from your computer if you no longer need them.

Troubleshooting & FAQs

What if I see a "connection refused" error after migrating?
This usually means your live site can‘t connect to the database, often due to incorrect info in the wp-config.php file or an improper import of the .sql file. Double check that the database values in wp-config.php are correct (database name, user, password). Also make sure you successfully imported the .sql file to the new database.

Can I migrate to a subdirectory?
Yes. If you don‘t want WordPress in the root directory of your domain (i.e. domain.com/blog instead of just domain.com), simply upload the WordPress files to the subdirectory instead of the root during migration. You‘ll also need to change the site URL in the database to include the subdirectory (http://www.yourdomain.com/blog).

How do I migrate WordPress without a plugin?
The manual method described above is how you migrate WordPress without using a plugin. Just follow the steps to export your database, upload your WordPress files, create a new database, edit wp-config.php, and then import your database .sql file to the new database.

Will migrating hurt my SEO?
As long as you keep the same domain name, migrating WordPress should not negatively impact your SEO. All your content, permalinks, titles, meta descriptions, etc. will remain intact. Just be sure to update any hard-coded internal links to pages or images to reflect the new domain name.

How long does migrating a WordPress site take?
The actual time to migrate WordPress can vary depending on the size of your site and server configurations. Generally though, expect it to take 30-90 minutes to complete the full migration following the steps above. Using a plugin is usually quicker than the manual method.

Hopefully this in-depth guide has given you the knowledge and confidence to move your WordPress site from local server to live hosting. Whether you choose the plugin route or go manual, just take it slow and double check your work.

Remember, migrating your site should be the final step after you‘ve designed, built and tested everything locally. Trying to make major development changes on a live site is a recipe for headaches. Build locally, then deploy live!

For further reading, check out our guides on creating a local WordPress development environment and the best WordPress hosting companies compared.

Did you like this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.