1. Create a temporary directory
# cat /etc/issue
Ubuntu 18.04.5 LTS \n \l
mkdir data/
2. Unzip the full file
xbstream -x -p 4 < ./全备文件.qp -C ./data/
innobackupex --parallel 4 --decompress ./data/
3. Delete the qp file
find ./data/ -name "*.qp" | xargs rm
4. Application logs
innobackupex --apply-log ./data/
5. Backup data
5.1 Stop the MySQL database service
systemctl stop mysql.service
5.2 Back up the original database directory
mv /var/lib/mysql /var/lib/mysql_bak
mkdir /var/lib/mysql
chown mysql:mysql /var/lib/mysql
6. Copy the full backup file and modify the directory permissions
innobackupex --defaults-file=/etc/my.cnf --copy-back /data
chown -R mysql:mysql /var/lib/mysql
7. Start the database
systemctl restart mysql.service
journalctl -fu mysql
reference:
- Restoring to self-built database through backup file
- Restoring the self-built database from the HUAWEI CLOUD database .qp backup file