Building a site locally is a good idea, but just hearing the word ‘migration’ can strike fear into even the noblest of hearts. Luckily, migrating from local to live is easier than you might think…
I don’t need to spend half an hour rambling on about why you should use a local environment to build your site…because I already did that here.
But just in case you’re too fatigued to click on the above link and go a-a-a-l-l-l the way to another post, let me give you the cheat notes…
Think Global, Build Localhost
A localhost or local WordPress setup is where you have WordPress and all of its required components like a database, PHP, and Apache server installed on your own computer or laptop instead of a webhosting server.
There are pros and cons to using a WordPress localhost environment.
When you set up WordPress online, you can share your posts and content with other online users immediately after creating these. Just click Publish and the whole world can access and view your content simply by entering a URL into their web browsers.
This isn’t quite as simple with a local version of WordPress because everything is hosted on your computer, rather than online.
One of the pros of using a localhost WordPress environment, then, is that you can create content, install, and test plugins and themes, mess with code and templates and customize files on your site without anyone else being privy to what you’re doing, as it all takes place in your own computer.
In addition to being able to mess with things without anyone taking a peek at what you’re doing, there are other benefits and advantages to using a localhost environment.
Like cost, for example. You don’t need to buy a domain or pay for webhosting until you are ready to take your site(s) live.
Note that I said site(s) above. That’s because with localhost, you can build as many sites as your computer can handle…and you can work from anywhere around the world because no internet connection is required (yes, smartypants…even underwater if your computer is waterproof).
By keeping a clone version of your real site on a localhost setup, you can also test different settings and customizations, make updates to your WordPress core installation, plugins, and themes, and spot any conflicts or issues that could affect your users before transferring these changes across to your live site.
Localhost, Not Local(g)host
I’m here to tell you that if you’ve never migrated a localhost site to a live one, it’s not as scary as it might seem.
Building a local or offline version of a WordPress working environment on your laptop or PC may sound like it’s hard and complicated, but it’s really not.
All you need is a way to install applications like Apache (server), MySQL (database), and PHP (program language) –note the acronym AMP, and there are several software packages (called stacks) that will let you do this.
These include LAMP (Linux), AMPPS (Softaculous), MAMP (Mac), WAMP (Windows), and XAMPP (Cross-Platform).
If you fancy giving it a try but you’re not quite sure how to get set up with localhost, check out this XAMPP tutorial.
Ok, Got It! Now, How Do I Take My Localhost Site Live?
There aren’t many WordPress-related dilemmas that can’t be solved with a good plugin, so you shouldn’t be surprised to learn that there are a few solid ways to migrate your site without needing to set foot anywhere near a database.
In this article, we’ll take a look at two easy-to-use methods to migrate WordPress from localhost to server and go live – Duplicator/SFTP, and our very own Shipper plugin.
Either method of migrating your site is better than Devman’s!
As Shipper is a Pro plugin, it’s only available to members, so if you’re not quite ready to take the leap, you can skip straight to the Duplicator tutorial further down the article (we won’t hold it against you.)
Migrate with Shipper
First things first, you need to have Shipper installed on both your local site and live one.
You can then open Shipper on your local site and select ‘Export’.
For local sites, you can only use the export option.
The next screen will show a list of the sites connected to your Hub – you’ll need to select your destination for the migration.
You are then given the option to exclude any files you don’t want to be included.
If you want to migrate your entire site and everything in it, simply click “Next”.
You can use the advanced tab to exclude seldom-used WordPress files that you probably won’t need such as:
- Spam comments
- Post revisions
- Inactive themes
- Inactive plugins
When you’ve decided what you’re taking with you, it’s time for the Pre-flight Check.
This will detect any issues that might crop up during migration and will display recommended solutions.
Keep your fingers crossed during this stage – migrations don’t always go through without a hitch (but our team is always on hand to help if needed!)
Once you make it safely past the check, you’ll need to choose a prefix for your database name.
By default, the WordPress database table prefix is wp_
When migrating tables with Shipper, you can migrate tables with:
- Source’s prefix
- Existing destination prefix
- Custom prefix
If you choose custom, try and ensure your prefix ends in an underscore, for example “newprefix_”
With setup complete, you’re now ready to begin the migration.
Click the button and then sit back and wait.
You’ll get a rough estimate of how long your site should take to migrate based on the size of your files, and you can keep track of the progress with the bar as shown below:
Shipper uses our advanced API to make sure the process is as stable as possible. It can take a long time to complete, but it’s worth the wait!
In the interest of complete transparency, I won’t sit here and claim that Shipper is completely immune to encountering migration headaches (you’ll be hard-pressed to find any plugin that is!).
For example, there’s no knowing when you might come across an incompatible file, or rogue bit of code – causing your migration to hit the wall.
The good news is, when you’re a WPMU DEV member, this should never be a reason to panic, as our expert team of WordPress superheroes are well-versed in rescuing people from migration misery.
Not a WPMU Member? Give Duplicator a Go!
So, Duplicator it is!
First things first – head to the plugin repo and download it.
The reviews speak for themselves.
Step One: Package and Download Your Files
Duplicator allows you to download two files – an archive of your content and configurations as well as an installer.php script.
These files hold everything you’ll need to transfer your site from one server to another.
Open Duplicator and click ‘Create New’ to start the process.
You’ll then need to name your file package ready for it to be compiled and downloaded.
If you want a complete transfer of your site, you only need to fill out the site name on this screen.
The Archive tab above allows you to exclude certain files from the transfer, just like with Shipper.
The Installer tab allows you to input the database installer fields – if you don’t know them, that’s absolutely fine as they’re optional at this stage.
You can now click “Next”, which will allow Duplicator to undertake a quick scan to make sure everything is in order before your files are compiled.
If the scan doesn’t detect any issues, you’re good to go.
Next, click the “Build” button,
Sit back and wait as your files are packaged.
Once your files are ready, you’ll be able to download them with the links below.
You’ll need to download both the archive folder which will include all your files, plus your installer file.
Use the One-Click option to download everything in one go.
Step 2: Copy Installer and Archive Files to Live Site
Now that you have everything you need from your old site, it’s time to transfer all the goodness to your new one.
You’ll be doing this with an SFTP client such as FileZilla.
Firstly, you’ll need to connect your SFTP client to your live site using your credentials. If you’re using our hosting (which, let’s be honest, you should be), here’s a simple guide to creating credentials and getting your connection set up.
Once your connection is established, you need to navigate to your public_html folder and paste all the files you downloaded (you may need to extract them from zips first).
A popup will appear asking if you want to overwrite your files – click yes to all.
You can keep an eye on the progress of the upload in the bottom left corner.
Unsurprisingly, the larger your site, the longer it will take!
Once your files are copied over, you’ll need to run the installer script.
You do this by heading to “your-url”/installer.php.
Just four simple(ish) steps now stand between you and a successful migration.
The first is easy – wait for the validation checks to be completed and hope they pass with flying colors.
If the checks do hit a hurdle, details of the issue(s) will be displayed.
You can then decide whether it’s something that requires fixing, or if it’s something that won’t interfere too much with the migration.
When you’re ready, click “Next”.
When you arrive at the next screen, you will have to enter four sets of details.
These details will allow the installer to connect to your live database and remove all the previous data.
You can get the details by heading to the hosting section of the Hub and clicking on ‘Tools’.
Click on ‘Reset’ and then confirm.
You can then head back into FileZilla and download a fresh copy of your wp.config file, which will display the host, database name, username, and password.
You will then need to enter them during this step of the installer.
When you’ve entered your details, click “Test Database”.
Step three allows you to rename your site if you need to.
Then…you guessed it – click next!
You’re almost there – just one last step!
All you need to do is click on the “Admin Login” button and log into WordPress.
Make sure you use the login details from your localhost site and not your previous live one!
Once you have successfully logged in, you will be back at the good ol’ WordPress dashboard.
Before you dive in, make sure you check the message from Duplicator:
The files should be removed automatically, however, if this is not the case, you will have to get rid of them yourself.
Time for a Migration Celebration or Commiseration?
All going well, your locally-built site has now been deployed onto your live server!
However, sometimes no matter which plugin you use, or how diligent you are, you’ll run into an issue or two.
This is exactly why a support team of WordPress Superheroes are so darn valuable.
When a problem hits, you don’t just need a second pair of eyes, you need reliable help, from a seasoned WordPress migrator, STAT!
We know that when you’re in the midst of a migration meltdown, the last thing you want to do is log a ticket and twiddle your thumbs for 24 hours.
Our live support team members know a thing or two about migrations and no matter who you’re hosting with or which method(s) you’ve tried, they’ll get you back on track.
We mean it when we say our support team is on hand to help with ANY WordPress query.
On that final note, if you’re reading this article because you’ve already had a migration malfunction, our Support Team is ready and waiting to help you finish what you started.
We’d even be as bold as to say sign up for a free trial if you get stuck in a migration rut and need a hand to pull you out.
We’re confident you’ll wonder how you ever coped without our awesome support team.
1.6 million WordPress Superheroes read and trust our blog. Join them and get daily posts delivered to your inbox – free!
Something went wrong, please try again later.
By clicking subscribe I consent to receiving product updates, news, and future contest emails from WPMU DEV.