• Categories
    • Tutorials
    • Beginners Guide
    • WordPress News
    • WordPress Security
    • Best WordPress Plugins
    • WordPress Themes
    • Product Reviews
    • WP Tips & Tricks
  • Guides
    • Start a Blog
    • Make a Website
    • WordPress Hosting
  • WordPress Hosting
    • A2 Hosting
    • HostGator
    • Bluehost
    • Cloudways
  • Managed Hosting
    • WPEngine
    • Rocket.net
    • WPX
    • Kinsta
  • Coupons
    • WPEngine
    • Flywheel
    • Cloudways
    • A2 Hosting
    • WPX Hosting
WordPress Tutorials

The Definitive Guide To Migrating A WordPress Site

Last Updated on: April 6, 2021 Ragnar 3 Comments

The Definitive Guide To Migrating A WordPress Site

Changed hosts and looking to migrate a WordPress site?

Look no further.

In this guide we’ll cover how to do it with a plugin, manually and we even cover a few hosts that do it for you for free, or have their own ways to make WP migration easy.

(Migrating To A Live Site?) Back It Up

If the site you are migrating to is a live site, for example if you have been updating and changing the site on a staged or local development version of your site, it’s best practice to back up your live site before you try import the copy.

If you don’t know how to back up your site, you can for example do some of the steps below using one of the plugins for your live site, or you can simply follow along with the manual migration part of the guide until you have your site files and sql database file downloaded.

You can also read more about backing up your site here, if you need further guidance.

If your website is an important part of your business, and downtime can have serious economic consequences, you should always do at least a manual cPanel and sql backup, on top of a plugin backup using a plugin like Updraft Plus or Backup Buddy, before you attempt any big changes like for example, importing a new version of your site.

You may even want to look into a service like JetPack Backups.

Migrate WordPress Sites Using A Duplicator/Migration Plugin

When migrating a WordPress Site, the two main ways to do it are to use a plugin, or to do it manually. Let’s start off with the easy part, how to do it with a plugin.

On WPKube, we’ve already covered how to move a site with the duplicator plugin, so in this guide we’ll take a look at the other major free migration plugin, All-in-One WP Migration.

(Updraft Plus  is another standout free backup/migration plugin, but the migration/duplication functionality is locked behind an add-on, which is why we didn’t focus this particular guide on that plugin.)

Migrate WordPress Sites Using The All in One WP Migration plugin

So obviously, the first step is to head over to Add New Plugins, search for: ‘All-in-One WP Migration’, and install the plugin, then activate it.

Note: Install the plugin both on the site that you want to migrate from, and the host you want to migrate to.

This means you need to install WordPress on the new webhost if you haven’t already. You can do this even if you haven’t switched nameservers yet for most hosts. Just log into the whatever dashboard they have, usually cPanel, head over to Softaculous, and install WordPress.

(If you don’t know how to get to the control panel, you can usually just log into your hosting account, select the service that you have, and then click through to the “dashboard” or “control panel”.)

Now that you have the plugin installed on both websites, on the website that you want to export, head over to All-in-One WP Migration in the WP Dashboard, and select export.

Export Your Site - All in One WP Migration Plugin

After the file is complete, download it.

After you’ve downloaded the file (the filename should be something like domain.com.wordpress), head over to your WordPress installation on your new host.

Login to the admin, head over to All-in-One WP Migration > Import. Then simply import the file.

Import Your Site - All in One WP Migration Plugin

Be aware that there is a size limit of 512 MB for the free version of the plugin, and that there is an increased risk of errors for really big sites, even if you do get the premium version so you can do unlimited size, so if you have a very large site, you will probably want to migrate your site manually.

If you’re changing hosts, and you import your site using a plugin before you’ve changed nameservers, you may have some broken links after the nameservers change, so alternatively, you can start with the next step first, although you will face some downtime, or you can simple re-import the site after the domain changes goes live if you’re facing any issues.

(If You’re Changing Hosts) Change The Nameservers For Your Domain

If you’re changing your host, you will need to change the nameservers for your DNS provider(the company you pay for your domain name). If your DNS provider is Namecheap, for example, login to the member area. Then go to the domain list.

Namecheap Domains

Now click the manage button next to the appropriate domain name, then scroll down until you see the nameservers section. Now you can change the name servers to the appropriate ones for your new host. When you’re done, click the check mark to save your changes, and you’re done.

Change Your Nameservers Namecheap

(If you don’t know the right nameservers for your new host, you can usually find them in your welcome email after you sign up. If not, you can try Googling: ‘hosting-company name servers’, and if that fails, send a message to customer support and they should reply with them shortly.)

Note: DNS changes can take up to 48 hours, so it’s recommended that you keep the site live on your old host until you’ve confirmed that the domain leads to the new host. If you don’t do this, your website could see extended downtime during this period, as the domain will usually still point to your old host for at least a few hours after the change.

Migrate WordPress Sites Manually

If you have a very big site, or you’re a perfectionist that simply likes doing all things by yourself, so everything is under your control, a manual migration would be the best choice.

Step 1: Download Your Files

First start up by backing up your files. You can do this by using an FTP client like FileZilla and saving the appropriate folder, or you can do it through a cPanel backup. (If you installed WordPress in your root domain, like most people, you should download your public_html folder onto your computer.)

If your FTP connection is exceptionally slow for whatever reason, you can also try simply archiving (zipping) and then downloading the same folder in the cPanel (or other dashboard’s) file manager. Sometimes this can be a lot faster for shared hosts that have very restricted ftp connections.

Step 2: Export The MySQL Database

You can do this easily from phpMyAdmin. Go into your hosting dashboard, and head over to phpMyAdmin.

Once you’re there, select the correct database.

database

(If you have more than one WordPress site on your host, you can find the appropriate database by looking at the wp-config.php file of the site you’re migrating. Inside it you can easily find the correct database by searching for DB_NAME.)

Finding Database Name For Migrating WordPress Site

Once you’ve selected the database, head over to export, and select go. Download the sql file.

Export WP Database

Done.

Step 3: Create a New Database for Your New Host And Import The Old Database

Head over to the “MySQL Databases” section of the cPanel of your new host. Here you simply create a new database with the same name as your old one.

Depending on your host, there might be a mandatory prefix to your databases. This means that even if you just write in the same name for your database, the real name ends up being:

mandatory_prefix_old_wp_database_name_99

In this case, you need to change the name of sql file to: mandatory_prefix_old_wp_database_name_99.sql, from it’s old name.

Now you can head over to phpMyAdmin, go to import, and import the sql file.

Then you need to open up the wp-config.php file that you downloaded, search for DB-NAME again, and change the value to the name of the new database.

Now we want to create a new user. Go down to “Add New User”

Add New MySQL User

Again there might be a mandatory prefix, in which case you have to open up your wp-config.php file again, search for DB_USER and change the user. If you also changed the password, you need to change the DB_PASSWORD also.

Now go down to add user to database, select the user you created, and add them to the database.

Step 4: Upload Your Files

Now all you need to do is upload the files you downloaded earlier to the appropriate (usually the root, public_html) folder of your new host.

Now go over to the the temporary URL of your new host, and you should be able to see your old WordPress site up and running on the new host. This means that you’re now ready to change the name servers.

Step 5: Change The Name Servers

Follow the exact same steps as mentioned above under the plugin section.

If you’re not changing hosts, but domains, or creating a dev version of your site, you need to do a few more changes…

(Not Changing Hosts, Just Creating A Local Or Staged Development Version or Changing Domain Only ?) Do A Few Final Changes

First go to phpMyAdmin, head over to wp_options, and change the ‘siteurl’, and ‘home’ fields’ values to the appropriate url.

You can also use a plugin like Better Search and Replace to search for and replace all your old urls with the new appropriate url for your local/staged version of WordPress.

This way you can change the url in all the places that you’ve just written it out, like for example in widgets or posts (images in posts will typically be broken unless you use a search and replace tool).

Hosts That Do WordPress Site Migrations For Free

Are you looking for a new host, but not completely comfortable doing your own migration even with a step-by-step tutorial? There are some hosts that offer free migrations when you sign up for their service. A few good examples are:

  • GreenGeeks
  • InMotion (our review)
  • Flywheel (our review + 33% off coupon)
  • WPEngine (our review + 20% off coupon)

These are all reputable hosts in the WordPress sphere and are good choices for people at different stages with their website.

If you are a beginner, and your site doesn’t have a lot of traffic, InMotion is a great option for shared hosting. They offer PHP 7, free https through easy let’s encrypt integration, and stellar customer support.

If your site is blowing up, you’re seeing heavy traffic and you need a little more than shared hosting, you can go with either Flywheel or WPEngine for managed WordPress hosting.

How To Migrate To WP Engine Specifically

WP Engine used to do the migrations for free, but now they actually have their own plugin that allows you to easily migrate sites to their platform.

You can get the plugin here.

Be Careful

When you’re doing big moves like migrating, especially if you’re implementing new functionality or a new design on your site, expect something to break. Be prepared. Like mentioned earlier, back your live site up, and double check that everything is working when your new version is live.

Congrats, you have now successfully migrated a WordPress site.

Let us know in the comments if you successfully migrated your website using these instructions.

+ Share
Disclosure

Ragnar

Ragnar is a passionate WordPress user and freelance writer for hire. When he's not writing or tinkering with WordPress, he's probably trying to learn a new language, or struggling to improve himself.

Related Posts

Back to all articles
  • How to Increase the Memory Limit in WordPress

    How to Increase the Memory Limit in WordPress

  • What is WordPress? A Beginner's Guide!

    What is WordPress? What Can it do & Is it Right for You? A Beginner’s Guide

  • How to Use Git to Push Your Local Site Live

    How to Use Git to Push Your Local Site Live

Coupons

View more deals
  • Recipe Card Blocks Coupon
    15% OFF

    Recipe Card Blocks Coupon

    Running a cooking or food website can be fun (and tasty) – but
    Get This Deal
  • WP 2FA Coupon
    20% OFF

    WP 2FA Coupon

    Security should be at the forefront of all site owner’s min
    Get This Deal
  • Themskingdom Coupon
    20% OFF

    ThemesKingdom Coupon

    First impressions count. As such, you’ll want a WordPress t
    Get This Deal
3 Comments Leave a Reply
  1. Muhammad Usman says

    December 6, 2016 at 7:50 am

    Very clear! I was just doing a website migration and seems like you got it all covered. It’s pretty much like working in a mine. 🙂

    Reply
    • Dev says

      December 9, 2016 at 10:26 am

      Glad you found it useful, Muhammad. Thanks for stopping by :).

      Reply
  2. Ahmad Raza says

    May 31, 2021 at 3:23 pm

    I’m just a beginner and I created a WordPress website just for practice I want to online my localhost already created WordPress website.. what can I do.. please guide me. I’m tired of everything because I’m not finding relevant content for it everybody is telling first to buy a free domain and hosting then install WordPress on it like 000webhost.com. but I want to online my already designed WordPress site for free..!

    Reply

Leave a Reply Cancel reply

Full Disclosure This post may contain affiliate links, meaning that if you click on one of the links and purchase an item, we may receive a commission (at no additional cost to you). All opinions are our own and we do not accept payments for positive reviews.

THE BEST OF WPKUBE

Some of the best content we have published so far.

BEGINNER GUIDES & REVIEWS

18 Best Cheap WordPress Hosting Providers in 2023 (From $1.99)
210 Best WordPress Hosting Options for 2023 (Pros & Cons)
38 Best Managed WordPress Hosting Providers for 2023 Compared
45 Best WooCommerce Hosting Providers Compared in 2023 (All Budgets)
5Top 9 Landing Page Plugins for WordPress (2023)
69 Best List Building Plugins for WordPress In 2023
7How to Fix the 500 Internal Server Error on Your WordPress Website
8Thrive Themes Review: A Look At The Full Membership
9Beaver Builder Review: Is it The Best Page Builder Plugin for WordPress (2023)?
10OptimizePress Review: Create Landing Pages with Ease
11How to Make a Website: Complete Beginner’s Guide
12Top 22 Best Free Stock Photo Resources For Your Site
1317 of the Best Google Fonts for 2023 (And How to Use Them in WordPress)
14How to Start a Blog in 2022 (Step by Step Guide)
15How To Fix ‘503 Service Unavailable’ WordPress Error
1611 Best Contact Form Plugins for WordPress in 2023
17How to Add a Custom Logo to Your WordPress Site
18How to Fix Error Establishing a Database Connection in WordPress

WPX Hosting: 50% OFF

Save 50% on WPX Hosting using our exclusive coupon code.

Get this Deal

Flywheel(our review)

Our Newsletter

Get awesome content delivered straight to your inbox.

Thank you!

You have successfully joined our subscriber list.

.
Featured In Forbes Huffpost Entrepreneur SEJ

About WPKube

WPKube is an online WordPress resource which focuses on WordPress tutorials, How-to’s, guides, plugins, news, and more. We aim to provide the most comprehensive beginner’s guides to anything about WordPress — from installing plugins, themes, automated installs and setups, to creating and setting up pages for your website.

We have over 500+ tutorials, guides, product reviews, tips, and tricks about WordPress. Founded by Devesh Sharma, the main goal of this site is to provide useful information on anything and everything WordPress.

Twitter Facebook

Useful Links

  • Behind the Scenes
  • Beginner Guides
  • WordPress Hosting
  • WooCommerce Themes
  • MeridianThemes
  • Exclusive WordPress Deals
View All Guides »

Reviews

  • WPEngine 33% OFF
  • Thrive Leads
  • Flywheel 33% OFF
  • Divi Theme 20% OFF
  • Thrive Architect
  • Elegant Themes
Reviews »

Deals

  • InMotion Hosting
  • LifterLMS Coupon
  • LiquidWeb Coupon
  • WPEngine Coupon
  • A2 Hosting
  • FloThemes
More Deals »
© Copyright 2023 WPKube ® All Rights Reserved.
  • Contact
  • Site Terms
  • Disclosure
  • Privacy Policy