2.8 KiB
KUBE / Restore
Restore
The restore process is divided into three stages:
- Restoring website files from the
<domain>directory or the<domain>.tar.gzarchive. - Restoring the
<domain>.conffile. - Restoring the database from the
<domain>.sqlfile or the<domain>.sql.tar.gzarchive.
Warning
If an error occurs at any stage, the process does not stop.
Warning
Files, databases, and other resources at each stage are either pre-cleaned or immediately overwritten without confirmation.
Commands
-r, --restore <domain> [action]
Restore site files and database from backup for a domain.
Example:
sudo kube.sh -r example.com
The source of resources for recovery is the directories defined in backupPath and backupLongTermPath.
In the backup folder is searched for 3 types of resources:
<source path>/<date>/<marker>/<domain>- directory with site files (file:d)<source path>/<date>/<marker>/<domain>.tar.gz- site file archive (file:a)<source path>/<date>/<marker>/<domain>.sql- site database SQL-file (db:f)<source path>/<date>/<marker>/<domain>.sql.tar.gz- site database archive (db:a)<source path>/<date>/<marker>/<domain>.conf- site database archive (conf)
The search results in a list of format: <counter>: <data> <marker> [<list of resource>]. Then you should specify the number of the selected marker for restore.
Note
If one resource is selected (
file:d/file:a/db:f/db:a/conf), only one resource will be restored. The other will remain unchanged.
Note
If there's a
file:dand afile:a. Priority is given tofile:d. If there's adb:fand adb:a. Priority is given todb:f.
Note
Once database are restored, the Redis keys for the domain are deleted.
Example:
1: 2025-04-29 14-22-22 [file:d file:a db:f conf]
2: 2025-04-29 14-20-20 [file:d db:a]
3: 2025-04-29 12-00-00 [file:a conf]
4: 2025-04-29 _first [db:a]
You can specify an additional parameter after the domain:
list- will display a list of available markers for restorelast- automatic site restore from thelast backupfull- automatic site restore from the lastFULL backupauto- automatic site restore from the lastFULL backupor thelast backupN- automatic site restore from thelast backup #N(N: 1+)
FULL backup is a backup that contains a copy of the site files, a copy of the database, and a copy of the .conf file
last backup #N marker number (starting from 1) in the list sorted by creation time (can be seen with the list command)
Example:
sudo kube.sh -r example.com list
sudo kube.sh -r example.com last
sudo kube.sh -r example.com auto
sudo kube.sh -r example.com 3
Warning
Restoring from the last full copy will be done without question.