Welcome to my tutorial on setting up local development and migrating your site to live. This was written for our local Des Moines WordPress Meetup. If you are in the area, come check us out! This was written late 2018, so if the instructions have gotten out of date, feel free to submit a PR.
For those attending the tutorial, please complete Part 1 before arriving to help us get through all the content. If you plan to obtain hosting before attending (not required!), Flywheel is a solid Managed Hosting option (Free 14-day Trial, I will be using SiteGround for my demonstration, and BlueHost is probably the most economic recommendation.
Part 1: Setting Up Local Dev
Options for Local Dev: Local By Flywheel, MAMP and Docker, oh my!
The easiest way I've found to start local development is by using Local by Flywheel. The software is provided by Flywheel, a managed WP host, but no purchase is required.
instructions for installation.I will be demonstrating with Local by Flywheel: Please follow these
Another popular historical method has been using a suite called MAMP for Mac, or WAMP or LAMP, for Windows and Linux, respectively. I recommend this as a fallback if Local by Flywheel does not successfully install on your computer.
MAMP or WAMP.If you have difficulty with Local by Flywheel, I suggest using
There are other methods of local development out there - including using Docker. Feel free to experiment with these if you'd like - but for this tutorial, I suggest using Local by Flywheel.
Part 2: Exploring WP Files and Database
This info graphic contains the overall architecture and a preview of each component that builds up your WP Site:
The key players in a WordPress site are the
Database and the
Site Files. You can download a fresh copy of the WP Files from WordPress.org or download the files here.
Within the main folder you'll find important files like
wp-config.php for database setup,
.htaccess for server configuration, and
index.php for initializing the website.
You'll also find three folders in the parent directory:
wp-content. Here is one approach to unpacking these folders and the database:
wp-admincontains the files that build up the
- The Admin Dashboard allows you to set and customize themes and to add content to your WP Site
- The content (posts, pages, etc) and settings in the
Admin Dashboardget saved into the
- The themes, plugins, and other uploads are stored in the
wp-includesfolder contains core WP files
- The site that you see when you navigate to the URL in your browser:
- Renders the contents from the
- To the specifications set in the
- With the help of the WordPress
- Renders the contents from the
Checking out our Database
As discussed, the
Database contains all the content and settings for your website. I'll show you how to locate your DB in Local by Flywheel. If you are familiar with investigating databases feel free to poke around, but be careful! Many changes here are irreversible.
- In Local by Flywheel again, click on the
- Click on the
- Here you can see what content is kept in the database: Posts, Pages, Comments, Users, etc
- If you are familiar with SQL you can perform queries here
- You can also import and export your database with this interface
- Together the WP files (the folder that contains
wp-admin) and the database contain all the information in your WP site
Getting to know your site
The files for your site will, by default, be located in a folder called
Local Sites in your home directory. Go ahead and find that now. The path to find your WP files will be:
Local Sites > Your Site Name > app > public
public folder there will be
wp-content. It is this last folder that is most important for the purposes of this tutorial.
wp-content folder you'll find the
themes folder. This contains all the themes that you'll find on the themes tab of our WP Admin.
Part 3: Investigating Local Site and Updating theme
Let's check out our local site from the
- Go to Local by Flywheel where you created your site
- Make sure the site is started
- Click on the
ADMINbutton -OR- click on
VIEW SITEand then type
- Log in to your WP admin dashboard with the credentials you used when creating your site
- On the left hand menu, you'll see a section called
Appearance, hover over this and click on
- You'll see several themes here, your current one says
Adding a new theme
You can feel free to try out different themes here by clicking on
Activate. You probably won't see too much happen, but there is a lot to add to your pages with
So, now you've seen where your themes live in the WP files and in the WP Admin, let's manually add another theme. Either browse around on the internet, or use theme provided here:
- If you have a theme you like, download it now, or go to Antreas or download the theme here
- Unzip the theme contents, and copy the whole folder into your theme directory
- Go to your WP Admin theme page and click refresh - notice now you have the them
- Go ahead and activate this new theme.
If you navigate to your website, you'll notice that the theme has now changed. The next step is optional and you don't want to do this on a site that has content on it already:
- Click on the theme and go to
- Go to the tab titled
- Click on
Import Content- this will load in content and custom post types
- Now go back to your website and click refresh and check out the change!
You can feel free to mess around with the theme if there is time. For now, we will take a short introduction to the database.
Part 4: Migrating to Live
While you can manually migrate your website by copying your files and exporting your DB - we will use a plugin to make this easier. In the tutorial I will be demonstrating using Duplicator with this tutorial, but the alternative is WP All-In-One-Migration.
If you have trouble downloading your duplicator files (or just want to see where the files got saved), navigate to the
public folder we looked at earlier with
wp-admin. Within this folder you will find
wp-snapshots - the two files you need from in here are
...archive.zip and the
Getting the above files onto your WP site is probably the most challenging part of this entire migration process. The following steps may help:
- Go to your hosting site > cPanel > File Manager -OR- FTP into your file system
- Navigate to your
public_htmldirectory, where you may or may not already have WordPress installed
- Create a new folder called
test-site(name doesn't matter, but it can't have spaces!)
- Upload both the installer and the .zip file in this directory
- Navigate to the URL:
- Continue to follow the instructions
If you are struggling with getting the Duplicator files up to your website. You can try to use WP All-In-One-Migration.
Closing: Best of Luck!
This is where our tutorial ends. I hope that you learned something useful! If you have questions or suggestion on this tutorial, my email is email@example.com and please come checkout our local Des Moines WordPress Meetup!