Backup and restore…

Red Blue Pill

Backing up and restoring a WordPress website almost seems too easy!

Seriously though, I didn’t have to hunt down a tutorial or anything. It’s pretty straight forward. Follow me!

It’s a simple 2 step process:

• First, you have to backup your website root directory folder.

Since I have three virtualhosts, I just copied and pasted each site directory folder side by side next to the live folder.

Note that “- Copy” is automatically appended to the directory name to tell them apart:

Duplicated Folders

• Second, you need to backup your corresponding databases for your website or virtualhosts.

Only 2 of my sites are using WordPress with SQL databases. I was able to use phpMyAdmin GUI to export them:

Export SQL

Optionally, you can use SQL CLI console to export them:

mysql> mysqldump -u [uname] -p[pass] db_name > db_backup.sql

You can save the .sql databases in the same directory as the virtualhost directory backups. Most likely I’ll move these to external storage:

SQL Backups

Of course, it has to best tested!

I deleted the site directory and dropped the SQL database with phpMyAdmin GUI:



Optionally, you can use SQL CLI console to drop them:

mysql> DROP DATABASE databasename;

Finally, restore the directory by duplicating the backup folder and remove”- Copy.” Import the corresponding .sql backup database in phypMyAdmin:

Import SQL DB

Optionally, you can use the SQL CLI console to import them:

mysql> use DATABASE_NAME;

mysql> source path/to/file.sql;

Now that I can easily backup and restore, I don’t have to pay a plugin provider to do it for me and I can explore the limits of WordPress by tinkering with anything and everything, breaking it over and over, and restoring it. Thanks anyway, JetPack.

Enable Backups