• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Jackie D'Elia | UX Designer

  • Articles, Tips and Tutorials
  • About Me
  • About this site
  • Contact
  • Show Search
Hide Search
Home » Articles, Tips and Tutorials » Keeping Your Local Database Safe During Development

Keeping Your Local Database Safe During Development

Written by Jackie D'Elia  |  Published on September 24, 2015  |  Updated on December 11, 2021

What a difference a year makes

Over the past year, my development workflow has changed dramatically. I’m now building client sites locally with GIT and Sass. Whenever I start a new project, I spin up a local WordPress install on a MAC using LocalWP. The ability to deploy my local development site to a staging or live server is one of the things that makes using it so powerful.

Some projects require that I download the client’s existing WordPress site and design the new site using a snapshot of their content and images. During the development process, my MAC is backing up the files on my drive with Time Machine to a NAS storage device in my office. It has two hard drives and keeps an exact copy of my backup on each one, so if one drive fails, my backup is not lost. This solves my need for a local backup. It’s the fastest way to restore a few select files or my entire system. Local backup is the first line of defense. The downside, there is no offsite backup in the event everything in my office suffers a catastrophic loss (theft, fire, tornado, flood….you get the idea).

Given all that – my local database is safe, right?

Well not exactly. I’m using GIT for version control, so I can easily roll back code changes, but what about my database? If it gets corrupted by a rogue plugin or version update – how do I restore it? I thought about this recently when a large client database got corrupted. Fortunately, I did have a backup, but it got me thinking, what if I had spent hours and hours building menus, entering content, and adding images? Where would that leave me?

There is no easy option in Time Machine to restore the database for one local development site. I know I’ve got the option to create a database backup in phpMyAdmin, but that’s a manual process. I am looking for a way to automate the process.

Automatic Backup of Your Local Database

That is where UpdraftPlus comes in. It’s my new favorite backup plugin. I first heard about it on the GenesisWP Slack forum. (Thanks Sridhar!)

I install the UpdraftPlus plugin on all of my local development sites, including this one I built for the Genesis Communities plugin I created.

Screen Shot of Local Development Site Home Page

If you’re searching for the plugin in the WordPress repository, be sure to select the correct one as there are currently two with similar names. UpdraftPlus (not Updraft) is the one you want.

UpdraftPlus Download from WordPress Repository

Once you activate the plugin, configure it through the Settings tab.

Settings are where you schedule backup intervals for the files and your database. I usually leave the files set at manual, since the Time machine is backing up my drive regularly (hourly for the current day). If I need to create a restore point, I can always back up my files manually in UpdraftPlus. I choose every 4 hours for the database backup. That provides an automatic layer of protection. You can also configure how many copies you want it to retain. For the database, I usually bump it up to 30 – just to be safe. If I’m getting ready to do a lot of changes, I can also perform a backup of the database manually as I do with the files.

UpdraftPlus Settings Page Options - Top Half

UpdraftPlus has a lot of nice features that make it an ideal backup solution for your website too. It handles large sites easily and it has the option to copy the backup to a remote server like Amazon S3, Dropbox, Google Drive, Rackspace Cloud, and many more. Their Premium version adds more options and permits scheduling backups for specific times.

UpdraftPlus Settings Page Options - Bottom Half

The Bottom Line

Be sure to back up your local database. I use the free version of UpdraftPlus to automatically backup my local development site database every four hours – with an option to manually run the backup if needed before making lots of changes. How are you backing up your local development sites?

[shared_counts location="shared-count-icons" style="fancy"]
Previous or Next Article
Previous Post: 2015 – A Year of Change2015 – A Year of Change
Avoid These Common Mistakes Adding Images to WordPress Next Post: Avoid These Common Mistakes Adding Images to WordPress

Filed under: Developer Tips, Genesis Tutorials, WordPress

sidebar

sidebar-alt

Connect

  • Twitter
  • Linkedin
  • Github
  • Dribbble

Copyright © 2014 - 2023 D'Elia Media LLC, All Rights Reserved. | Privacy Policy