Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Databases, Migrations & SQL: Oh My! Introduction to WordPress Database & Migrations

Jim True
February 01, 2018

Databases, Migrations & SQL: Oh My! Introduction to WordPress Database & Migrations

Presented at WordPress St. Petersburg Meetup, 2/1/2018

You've created your new website design on your own host or on your local laptop and now you're ready to launch for the client. Do you suddenly _cringe_ at the concept of having to migrate the site? Have you done it before and it's always a mess and a headache and you wish you had a method that always worked? This meetup might be for you!

We'll be talking about most things database, but will cover some of the basics of site migration:

- Tour of the WordPress Database
- What those tables mean and what they control
- Where the files are stored that are specific to your WordPress configuration
- What things specifically have to change when you migrate
- Some easy plugins for painless migrations

If you have a special plugin that you love and you want to sing its praises, let me know ahead of time and we'll include it in the talk. Be prepared to come with your questions!

Jim True

February 01, 2018

More Decks by Jim True

Other Decks in Technology


  1. Databases, Migrations & SQL: Oh My! Intro to WordPress Databases

    & Migrations WordPress St. Petersburg
  2. Jim True Support Lead & Community Manager
 Pods Framework pods.io

    | @podsframework jimtrue.com | @jimtrue
  3. How many times has this happened to you?

  4. You’ve worked on a Site for Days

  5. You’re Happy with the Site

  6. Client is Happy with the Site

  7. Even better, they’ve PAID you

  8. Now you have to move it to their server

  9. And you’re suddenly lost ?

  10. Where do you Start? FILES DATABASE

  11. Where do you Start? WHICH FILES? WHICH DATABASE?

  12. Let’s Start with WordPress WordPress wp-config.php WP-CONFIG.PHP contains the database

    connection parameters and any special configurations for your particular install. It will be different for every WP Install, but you need to at least have a copy of the file for reference when you migrate.
  13. Grab the Specific Content WordPress wp-content/ wp-config.php The only folders

    that are specific to this install are contained under wp-content
  14. The Themes, Plugins & Images WordPress wp-content/ wp-config.php themes/ ALL

    files & directories plugins/ ALL files & directories uploads/ ALL files & directories
  15. Now for the Database DATABASE Users wp_users & wp_usermeta Posts

    wp_posts & wp_postmeta Comments wp_comments & 
 wp_commentmeta Taxonomies wp_terms & 
 wp_term_taxonomy &
 wp_term_relationships Plugin & Theme Settings wp_options
  16. So basically just copy those to the new server and

    I’m done, right?
  17. Not enough to just copy files & DB • wp-config.php

    needs new DB credentials • Site URL needs to be changed in wp_options • URL & Paths need to be changed in ALL places where they appear in the database: Media Paths, internal links, etc.
  18. Step by Step Copy & Import 1. SQL Dump of

    the Database 2. Copy Files from wp-content & DB Dump to new Server 3. Create new database, create a user & import data from SQL Dump 4. Update wp_config.php with DB details (#3) 5. Update wp_options with Site URL 6. Login to wp-admin and go to Settings, General (Site URL) & Save 7. Search & Replace paths (post_content) in wp_posts for Image & Media Links http://www.wpbeginner.com/wp-tutorials/how-to-move-wordpress-from-local-server-to-live-site/
  19. There’s gotta be an easier way, right?

  20. Yep, we’ve got tools for that! Updraft Backup
 Buddy WP

 Migrate Pro*
  21. Determine your Needs Backup Files & Database Yes Yes DB*

    Offsite Backup Storage Yes Yes Yes* Scheduled Backups Yes Yes Yes* Multisite Support Yes Yes Yes Easy Migration Setup Yes Yes Yes
  22. Backup Buddy by iThemes • Database & File Backups (including

    other tables on site) • Scheduled Backups & Offsite Backups (great if your server crashes or the client destroys it!) • SIMPLE Migration Tool: One file created by BB, copied to new site, handles full file & database creation & restore with a step by step wizard. • NO Free Version https://ithemes.com/purchase/backupbuddy/
  23. UpdraftPlus (& Other plugins) • Database & File Backups (including

    other tables) • Scheduled Backups & Offsite Backups (great if your server crashes or the client destroys it!) • Cloning & Migration Tool, also UpdraftVault, UpdraftMigrator and UpdraftCentral (great for people supporting tons of sites) • Free Version does Backup & Restore, some Offsite Storage, Scheduled Backups https://updraftplus.com/
  24. WP DB Migrate (& Pro) • Database Backups & Media

    (with Add-on to Pro version). NO files. • Push & Pull Technology from WP Site to WP Site. Great for Development/Staging/Live Environments. • Very Powerful Pro Version: Determine Data Flow, Exclude/ Include Custom Post Types, Multisite Support (including pulling sites in and out of Network) and WP-CLI support. • Free Version only does Database Backup & Search/Replace https://deliciousbrains.com/wp-migrate-db-pro/

  26. Resources & Links • Tour of the WordPress Database:

    • How to Move WordPress From Local Server to Live Site:
 http://www.wpbeginner.com/wp-tutorials/how-to-move-wordpress-from-local-server-to-live-site/ • How to Move WordPress with Duplicator:
 http://www.wpbeginner.com/wp-tutorials/how-to-move-wordpress-to-a-new-host-or-server-with-no-downtime/ • Seven Best Backup Plugins (Pros & Cons):
  27. Jim True Support Lead & Community Manager
 Pods Framework pods.io

    | @podsframework jimtrue.com | @jimtrue
  28. WordPress St. Petersburg Downtown St. Pete @ TEC Garage

    & 3rd Thursdays / Monthly Meetup: https://meetup.com/WordPress-St-Petersburg
 Web: https://tampabaywp.org
 Slack Chat | Facebook Group | Meetups
 A Member of Tampa Bay WordPress Network
  29. None
  30. Upcoming Events Sponsored by TEC Garage
 & Tampa Bay Innovates

    Tech Talk
 Next Event: February 13th “Leading with Purpose: How Our Mission Drives Revenue
 at the Penny Hoarder @ Microsoft
 5426 Bay Center Dr Ste 700, Tampa, FL 33609 
 FREE Registration Required: