To make a complete backup of your website you need to backup both the database and the files. It is best practice to backup your database and files prior to upgrades, updates or installation of new plugins that can alter the database and/or files.

If you have these backups, restoring to the backed up state is done in minutes. We backup files to the private/ directory, which is inaccessible from the internet.

Make sure there is enough space available on your Bolt to store the backups.

Backing up the WordPress database from SSH

Log in through the terminal and write:

cd private/
wp db export --path=~/public/

Using wp is the easiest way. If this does not work for some reason, you can use mysqldump to achieve the same result.

Backing up the WordPress files from SSH

cd ~
tar -czf ~/private/backup.tgz public/

This will make the file backup.tgz containing your compressed (z) archive to save disk space. The process takes time depending on the size of your public/ folder.

Restoring from these backups

Restoring the WordPress database

You can list the files in your private directory with the command ls. This will list the database backup filename ending with .sql. 

ls -la ~/private/
wp db import --path=~/public/ ~/private/database_dump_name.sql

Restoring the WordPress files

Go to your home folder (~) and extract the archive from there.

cd ~
tar -xvzf ~/public/backup.tgz

Did this answer your question?