Delve into the specifics of WordPress database backup and restoration with this tutorial. With a focus on using the WP-DB-Backup plugin, this tutorial provides clear instructions on how to secure your site's content and restore it if need be.
Key Insights
- The WP-DB-Backup plugin is a crucial tool for WordPress sites, allowing regular backup of the site's database contents.
- The plugin can be installed through the site's admin dashboard and by searching for 'WP-DB-Backup' in the plugins section, followed by installation and activation.
- Settings for the WP-DB-Backup plugin can be adjusted through the 'Backup' section in 'Tools', where users can choose which tables to back up and where to download the backup.
- Users can test the effectiveness of the backup by making significant changes to the database, such as moving all pages to trash, and then attempting a restoration.
- The restoration process involves logging into phpMyAdmin, selecting the relevant database, and importing the previously downloaded backup file.
- After the restoration process, all previously trashed pages (or other changed aspects) should be restored to their original state, confirming the backup's effectiveness.
Learn how to install the WP-DB-Backup plugin, back up and restore your WordPress site's database, adjust the backup settings, make changes to your database, and restore it using the backup in this comprehensive WordPress tutorial.
This exercise is excerpted from Noble Desktop’s past WordPress training materials and is compatible with WordPress updates through 2020. To learn current skills in WordPress, check out our WordPress Bootcamp and coding bootcamps in NYC and live online.
Topics Covered in This WordPress Tutorial:
Installing the WP-DB-Backup Plugin, Backing up & Restoring
Exercise Preview
Exercise Overview
WordPress sites rely on a database to contain all the content of the site. Therefore, it is very important to back up your database on a regular basis. Luckily, there’s a great plugin that can instantly back up or schedule backups for your site. In this exercise, you will learn to use the WP-DB-Backup plugin to back up a site’s database.
Installing WP-DB-Backup
- Go to:
- Mac: localhost:8888/mrp/wp-admin
- Windows: localhost/mrp/wp-admin
Log in to the site.
Go to Plugins > Add New.
In the Search field, type wp-db-backup and hit Return (Mac) or Enter (Windows).
Find WP-DB-Backup (it should be at the top) and click Install Now.
When asked if you are sure you want to download the plugin, click OK.
Click Activate Plugin.
Adjusting Settings
Let’s configure the plugin! On the left side of the Dashboard, go to Tools > Backup. Here you can adjust the various WP-DB-Backup backup settings.
The WP-DB-Backup plugin will back up the core tables by default; if you want to back up any other tables, you will need to check them.
Scroll down to Backup Options.
Choose Download to your computer, if it’s not already selected.
Click the Backup now! button.
If it doesn’t automatically download, then a window will pop up asking if you would like to save the file. Click the Save File button. If it asks where to save, put it in your Downloads folder.
Making a Change
Let’s make a change to our database so that we can make sure the backup is working correctly. On the left side of the screen, click Pages.
Click the checkbox next to Title to select all of the pages.
From the Bulk Actions menu, choose Move to Trash.
Click Apply. Oh no, all our pages are gone! Let’s test the backup by restoring our database.
Restoring with the Backup
- In the event something catastrophic happens and you lose your database, you will need to restore it from a backup. To do this, log into phpMyAdmin as shown below:
Mac
- Switch to the MAMP application.
- Click Open WebStart page if the MAMP start page doesn’t automatically open in your default browser.
- On the start page, in the nav menu, go to Tools > phpMyAdmin.
Windows
- Open XAMPP.
- In the control panel, ensure the Apache and MySQL services are running.
- Open your browser and go to localhost
- On the start page, on the left sidebar, under Tools, click phpMyAdmin.
On the left, select mrp from the list of databases.
-
Click on the Import tab.
On the next screen, click the Choose File or Browse button.
Navigate to your Downloads folder (or the folder the database was downloaded to).
Double–click the backup SQL file you had just downloaded (it should be named mrp_wp_YYYYMMDD_###.SQL.gz).
Click the Go button.
- Go to:
- Mac: localhost:8888/mrp/wp-admin
- Windows: localhost/mrp/wp-admin
On the left side of the screen, click Pages. Whew, all our pages have been restored! That was a close one.