Restoring ManageWP Backup with WP-CLI

ManageWP is my goto choice for managing WordPress and WooCommerce stores. The incremental backups ManageWP offer along with simplified update management with the automatic rollback from the safe update feature make it really attractive if you have maintenance clients or manage a lot of sites and stores. It also helps make developer life easier if you can send a link to a zip file that contains the backup files and database. This tutorial will show you how to restore a ManageWP backup zip file using WP-CLI.

It is a very good idea to verify your backups actually work, backups are useless unless you know they work!

How to Restore ManageWP Backups with WP-CLI

First we need to generate the backup zip using ManageWP.

Log into ManageWP.

Click the green Download button to begin the backup zip generation.

After a few minutes ManageWP will send you a link to the zip file it generated from your backup files.

Right click the blue download button to get the URL

Now that we have the download link from ManageWP you can SSH into your server where you wish to restore the backup.
Make a temporary directory on the server

mkdir /tmp/site-backup
cd /tmp/site-backup

We are going to use wget to download the zip which has this format wget -O /tmp/site-backup/

wget "" -O

Unzip it (run sudo apt install unzip if you don’t have unzip)

unzip -q

We are going to copy all of the site files over to our destination path, here it is /var/www/ We are going to exclude the file and the wp-config.php files.
I am also excluding the mwp_db folder since that contains the MySQL database dump and we don’t want that exposed. We will be importing the database in the next step

rsync -a --info=progress2 /tmp/site-backup/ /var/www/ --exclude=mwp_db --exclude=wp-config.php

This guide assumes you already have the empty WordPress site and database configured correctly.

Let’s find out the name of the database dump so we can import it.

ls /tmp/site-backup/mwp_db

Based on this output we can see the filename is

Go to the site folder (here /var/www/ and import the database using WP-CLI.

cd /var/www/
wp db import /tmp/site-backup/mwp_db/ --allow-root

All done 🙂

If you need to do any domain changes then see this more in-depth tutorial.