I have main server which have mysql 5.7 ,i have backup taken using xtrabackup 2.4
,now i want to migrate to new server and have percona mysql 8.0.32 and xtrabackup 8.0.32.
i prepare the backup in main server with xtrabackup 2.4 and trying restoring in new server with xtrabackup 8.0.32 ,but it is not working
[root@localhost mysql]# xtrabackup --copy-back --target-dir=/home/backup-1/
2024-02-06T21:20:56.970037+05:45 0 [Note] [MY-011825] [Xtrabackup] recognized server arguments: --datadir=/var/lib/mysql
2024-02-06T21:20:56.970481+05:45 0 [Note] [MY-011825] [Xtrabackup] recognized client arguments: --copy-back=1 --target-dir=/home/backup-1/
xtrabackup version 8.0.32-26 based on MySQL server 8.0.32 Linux (x86_64) (revision id: 34cf2908)
2024-02-06T21:20:56.970931+05:45 0 [Note] [MY-011825] [Xtrabackup] cd to /home/backup-1/
2024-02-06T21:20:56.972135+05:45 0 [ERROR] [MY-011825] [Xtrabackup] cannot open file ‘./xtrabackup_tablespaces’
2024-02-06T21:20:56.972165+05:45 0 [ERROR] [MY-011825] [Xtrabackup] failed to load tablespaces list.
2024-02-06T21:20:56.972177+05:45 0 [ERROR] [MY-011825] [Xtrabackup] It is possible that the backup was created by Percona XtraBackup 2.4 or earlier version. Please use the same XtraBackup version to restore.
[root@localhost mysql]# xtrabackup --copy-back --target-dir=/home/backup-1/ --data-dir=/var/lib/mysql
2024-02-06T21:22:37.838136+05:45 0 [Note] [MY-011825] [Xtrabackup] recognized server arguments: --datadir=/var/lib/mysql
2024-02-06T21:22:37.838450+05:45 0 [Note] [MY-011825] [Xtrabackup] recognized client arguments: --copy-back=1 --target-dir=/home/backup-1/
xtrabackup version 8.0.32-26 based on MySQL server 8.0.32 Linux (x86_64) (revision id: 34cf2908)
2024-02-06T21:22:37.838558+05:45 0 [Note] [MY-011825] [Xtrabackup] cd to /home/backup-1/
2024-02-06T21:22:37.839382+05:45 0 [ERROR] [MY-011825] [Xtrabackup] cannot open file ‘./xtrabackup_tablespaces’
2024-02-06T21:22:37.839415+05:45 0 [ERROR] [MY-011825] [Xtrabackup] failed to load tablespaces list.
2024-02-06T21:22:37.839428+05:45 0 [ERROR] [MY-011825] [Xtrabackup] It is possible that the backup was created by Percona XtraB
This is not the correct process. You can only restore 5.7 backup using PXB 2.4. You cannot use 5.7 backup with PXB 8.
- Take a backup of 5.7 using PXB 2.4
- Restore backup to new 5.7 MySQL
- Upgrade to MySQL 8 by removing 5.7 packages and then installing 8.0 packages. Start mysql. Wait for upgrade. Check mysql error logs for any failures.
- After mysql 8 successfully upgrades, you can now take a backup using PXB 8.