Introduction
Backup and restore procedure using wp-toolkit tool from CLI
Procedure
Backup WordPress instance:
1. Find the desired instance ID to proceed with backup, please note the first ID, not the `owner ID`
[root /]# wp-toolkit --list
ID Installation Path Owner ID State Hidden Website URL Name Version
1 /public_html 2 Working false https://www.example.com Inspiration Station 5.8.1
2. Run the backup process on the desired instance ID
[root /]# wp-toolkit --backup -instance-id 1 -operation backup
backupFilename www.example.com__2021-09-27T08_22_24+0000.tar.gz
Restore WordPress instance:
1. Find the desired instance ID to proceed with restore, please note the first ID, not the `owner ID`
[root /]# wp-toolkit --list
ID Installation Path Owner ID State Hidden Website URL Name Version
1 /public_html 2 Working false https://www.example.com Inspiration Station 5.8.1
2. List available backups
[root /]# wp-toolkit --backup -instance-id 1 -operation list
Filename
www.example.com__2021-09-27T08_22_24+0000.tar.gz
www.example.com__2021-09-27T05_24_55+0000.tar.gz
3. Perform the restore using the desired backup filename
[root /]# wp-toolkit --backup -instance-id 1 -operation restore -filename www.example.com__2021-09-27T05_24_55+0000.tar.gz
[root /]#
Upon the backup completion, the wp-toolkit will not print any info on the screen if the restore procedure succeeded.
You may want to check the backup log to be sure the backup has been successful.
4. Check the backup log, replace the DATE string with your actual date
[root@10-2-48-77 /]# tail -30 /usr/local/cpanel/3rdparty/wp-toolkit/var/logs/main-2021-09-27.log
[2021-09-27 08:42:38.717] DEBUG Checking if CageFS is enabled for remote server #1 (localhost)
[2021-09-27 08:42:38.717] DEBUG CageFS is disabled for remote server #1 (localhost)
[2021-09-27 08:42:38.778] DEBUG Acquire lock 'simplesitebackup_c4ca4238a0b923820dcc509a6f75849b'
[2021-09-27 08:42:38.778] DEBUG Lock 'simplesitebackup_c4ca4238a0b923820dcc509a6f75849b' acquired successfully
[2021-09-27 08:42:39.607] INFO Restore instance files
[2021-09-27 08:42:42.235] INFO Restore instance configuration
[2021-09-27 08:42:42.988] INFO Restoring instance database
[2021-09-27 08:42:43.490] INFO Restoring instance meta information
[2021-09-27 08:42:43.612] DEBUG Release lock 'simplesitebackup_c4ca4238a0b923820dcc509a6f75849b'
Comments
0 comments
Article is closed for comments.