How to backup your WordPress site

We include a daily backup of all files and databases for our clients. These backups are performed nightly and can be restored through our support, as described here: How do backups work at Servebolt.

It’s also possible to do an instant manual WordPress site backup. This is recommended when performing a larger install or update of WordPress, themes or plugins. A complete site backup requires backing up both files and database.

With an instant backup, it’s possible to restore a WordPress site in just a few minutes.

In this guide we will backup everything to the ~/private/ directory, which is inaccessible from the internet. We will execute the backup commands using terminal access through SSH.

Note that the manual backup will require additional storage on your Bolt. If you need more storage, simply login to our Control Panel and upgrade your plan or add more storage. Additional storage added through our Control Panel is available immediately.

Backup and restore a WordPress site

Time needed: 10 minutes.

Here is how to create and restore a backup of a WordPress site in just a few minutes.

  1. Backup the database

    Login to the server using your SSH user and write:

    cd public
    wp db export ../private/backup.sql

    This is the the easiest way to backup the database of a WordPress site. If it does not work, you can also backup the database as described here: Exporting a database.

  2. Backup the files

    Next we’ll create an archive of all files, like this:

    tar -czf private/backup.tgz public

    This will create a file named backup.tgz in the /private folder. It is a compressed archive, to save disk space. Note that this may take some time depending on the size of all files.

  3. Restore the database

    To restore the manual database backup, login using SSH and write:

    cd public
    wp db import ../private/backup.sql

    This requires that the database backup was created using the name backup.sql. Once the restoration is done, you’ll see a confirmation of the import process.

  4. Restore the files

    Then we navigate back to the home folder and restore the previously backed up files.

    tar -xzf private/backup.tgz

    This also requires that the files were backed up using the name backup.tgz. And it may take some time depending on the size of the files.

Feel free to contact our Support Team if you have any questions regarding this.

Give us your feedback on this article