Skip to content

micleners/wp-local-dev-to-live

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

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.

I will be demonstrating with Local by Flywheel: Please follow these instructions for installation.

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.

If you have difficulty with Local by Flywheel, I suggest using MAMP or WAMP.

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

WordPress Architecture

This info graphic contains the overall architecture and a preview of each component that builds up your WP Site:

WP Architecture

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-admin, wp-includes, and wp-content. Here is one approach to unpacking these folders and the database:

  • wp-admin contains the files that build up the Admin Dashboard
  • 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 Dashboard get saved into the Database
  • The themes, plugins, and other uploads are stored in the wp-content folder
  • The wp-includes folder contains core WP files
  • The site that you see when you navigate to the URL in your browser:
    • Renders the contents from the Database
    • To the specifications set in the Admin Dashboard
    • With the help of the WordPress Site Files

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.

  1. In Local by Flywheel again, click on the DATABASE tab
  2. Database Management
  3. Click on the ADMINER button
  4. Adminer
  5. Here you can see what content is kept in the database: Posts, Pages, Comments, Users, etc
  6. Databases
  7. If you are familiar with SQL you can perform queries here
  8. You can also import and export your database with this interface
  9. Together the WP files (the folder that contains wp-content, wp-includes and 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

Within the public folder there will be wp-admin, wp-includes, and wp-content. It is this last folder that is most important for the purposes of this tutorial.

In the 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 Admin Dashboard:

  1. Go to Local by Flywheel where you created your site
  2. Make sure the site is started
  3. Click on the ADMIN button -OR- click on VIEW SITE and then type /wp-admin behind your *.local URL Click Admin
  4. Log in to your WP admin dashboard with the credentials you used when creating your site
  5. On the left hand menu, you'll see a section called Appearance, hover over this and click on Themes Go to Themes
  6. You'll see several themes here, your current one says Active

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
Activate
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:

  1. If you have a theme you like, download it now, or go to Antreas or download the theme here
  2. Unzip the theme contents, and copy the whole folder into your theme directory
  3. Copy Theme
  4. Go to your WP Admin theme page and click refresh - notice now you have the them Antreas.
  5. 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:

  1. Click on the theme and go to About Antreas
  2. Antreas
  3. Go to the tab titled Recommended Actions
  4. About Antreas
  5. Click on Import Content - this will load in content and custom post types
  6. Recommended
  7. 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-content, wp-includes and wp-admin. Within this folder you will find wp-snapshots - the two files you need from in here are ...archive.zip and the ...installer.php.
Duplicator Files

Getting the above files onto your WP site is probably the most challenging part of this entire migration process. The following steps may help:

  1. Go to your hosting site > cPanel > File Manager -OR- FTP into your file system
  2. Navigate to your public_html directory, where you may or may not already have WordPress installed
  3. Create a new folder called test-site (name doesn't matter, but it can't have spaces!)
  4. Upload both the installer and the .zip file in this directory
  5. Navigate to the URL: your-domain.com/test-site/installer.php
  6. 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 mb.johnsonbece@gmail.com and please come checkout our local Des Moines WordPress Meetup!

About

Tutorial on setting up local WP dev environment and migrating to live

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published