Migrating your sites between LbF and your live server
Depending on what you were really working on, there are several ways for you to send your locally developed site to your live web server. Some of us use the local environment in general (whether you’re using LbF, AMPPS, MAMP, etc.) just to build and test our custom themes or plugins. And then, there are others who use the local environment to build their sites which also includes the basic content (such as the About section, Links section, etc.) We’re going to take a look on how we’re going to approach migration in different ways.
Migrating your ENTIRE site to your live web host
There are several ways to do this, and the fastest, easiest way to do is to install a migration plugin to your WordPress. There is an Export feature in LbF that you can use to zip up your entire site project into a huge zip file. This also includes the MySQL database that LbF created for you when you first set up your site.
There is one bit of a problem in using this feature. You would have to do a lot of multiple steps from this point, right at your live server’s end:
- Install a fresh WordPress installation in your live server.
- Upload/replace the core files with the files you created from the LbF zip file you exported.
- Unzip the zip file and import all the MySQL database files.
Most likely, you will run into a slew of errors here and there, and in the end, you’ll all end up getting a lot of headaches trying to get your newly-built site to work. So, to save all the frustrations on getting your site live up on the web, it’s a lot better, faster, and more efficient to transfer your locally built site to your server using a migration plugin.
Migration Plugins
WordPress has grown over the years that countless and countless of really good and free plugins have been growing. When I migrate (live) servers, I use a plugin called Duplicator and it has saved me a lot of trouble migrating. This, aside from your mySQL database, includes all of your themes installed, all of the plugins you installed, all of your media files, everything. That also includes your draft posts too.
There are plenty of migration plugins that you can choose from. Flywheel recommends Migrate Guru. Other more prominent web development bloggers use others like UpdraftPlus and All In One WP Migration. There are also paid plugins like BackupBuddy and VaultPress.
Each of these migration plugins have their own instructions, but the basic rules that I’ve seen so far go something like this:
- Install your migration plugin to the WordPress site you are planning to migrate. Follow the plugin’s instructions carefully.
- Some of these migration plugins require you to re-install the same migration plugin you’re using to your destination and then they have specific instructions on how you can import your backup. This would also mean that you need to have a fresh install first.
However, with the Duplicator plugin that I frequently use, you just simply install the plugin to the site you’re going to migrate and it will generate a zip file and another file along with it. Per the instructions, you just upload these files in your destination folder without installing a fresh install of WordPress prior. You go to the file using your domain name, follow the on-screen directions, and then you get your site migrated, safe and sound.
There are plenty of migration plugins throughout the WordPress plugin directory that you can find and discover, depending on what your site needs. For example, if I were going to migrate a WordPress multisite, I would have to purchase the premium version of the Duplicator called Duplicator Pro (and they are pretty pricey). I would have to find another migration plugin should I ever have to migrate a multisite in the future.
However, what if you want to do the opposite? You know, you want to work on your existing site in private without putting some “Under Construction” or “On Hiatus” notice on your main page?
Migrate your EXISTING site FROM your live server
Say you want to work on a super-secret feature on your existing site but you don’t want your visitors to see and get spoiled with your upcoming surprise by seeing your site as being “Under Construction” or “On Hiatus,” just because you are currently working on the site itself? You don’t want that, right?
You can simply migrate your existing site from your live server to LbF by doing the same thing: migration plugins. However, there is also an easier way to do this without installing any migration plugins whatsoever. It may require you to do a few manual bits, but all you need to do is the following:
- Backup your mySQL database. (please ask your tech support on how to do this, knowing some web hosts don’t use suites like phpMyAdmin)
- Backup your
wp-content
folder. - Place both your mySQL database file and your
wp-content
folder in a zip file. - On the LbF interface, click on the hamburger menu icon at the top left corner and choose Import site. See below:
- LbF will “fill the rest” of the core WordPress files. I haven’t tried this method yet but whatever it is you see on the screen, just simply follow instructions.
- See this thread for more information.
For the most part, personally I don’t import my entire site to my local environment, even when I was still using AMPPS in the past. I mostly build locally for a new WordPress theme or just testing a plugin. But if you really do need to import your entire existing site to LbF, the basics are mentioned above.
When you are finished and ready to bring your updates live, just simply replace your database and your content folder. Or, you can use a migration plugin to do this.
I’m building WordPress themes to offer for free and/or selling them. How do I export them from LbF?
As you know, WordPress themes always come in zip files. When you are finished building your themes, just simply zip them, upload them to your server or a storage drive or somewhere where all your users and customers can see and be able to purchase/download them. That’s it.
In conclusion…
I may put up an aFAQs section right after this one, however, this concludes my introduction and tutorial to building WordPress sites locally using Local by Flywheel. I know there are probably other features that I haven’t covered here, but the ones I showed here are just the basics. This may not be the best tutorial, but hopefully this should give you some ideas on how beneficial building your WordPress sites (or any PHP script-based sites like fanlistings and forums) locally without uploading them to the live server first.
The friendly support community is always available for all your LbF needs when you run into some troubles.
Thank you very much for joining this fun journey. More WordPress theme tutorials coming up soon!