Not the answer you need?
Register and ask your own question!

Xtrabackup Binary?

mds1256mds1256 EntrantInactive User Role Beginner
Hi

I am just new to Xtrabackup and going through a few scenarios on my test environment I have.

I have read in the documentation that there is a 'xtrabackup_binary' in the backup folder, but I don't seem to get this when I do my backups?

So my question is, if I want to restore my backup to a brand new server to simulate a total server failure, e.g. fresh build and a fresh build of mysql do I have to do the following:

1. new fresh build of my server with same version of mysql installed and all my.conf tweaks carried out.
2. have a copy of my backup files on my server ready to restore
3. Install Xtrabackup on new server (this is where I though the xtrabackup_binary would have allowed me to restore without installing xtrabackup?)
4. stop mysql service on new server
5. prepare backup on new server
6. restore backup on new server using the copy-back option
7. start mysql service

Is that the proper way to restore? Also is it best to prepare on the original server as part of the backup or is it ok to prepare on the replacement server?


Thanks

Comments

  • jriverajrivera Percona Support Engineer Percona Staff Role
    Let's say you want to restore your backup on a new server, you can follow these steps:

    - install exact same version of MySQL/Percona Server used on the source server to the new server, so if you used MySQL 5.6.36 on source server install Percona Server 5.6.36 as well on the new server
    - move all the backup files to the new server
    - if mysql is running on new server stop it and empty the datadir (service mysql stop; rm -rf /var/lib/mysql/*)
    - prepare the backup on the new server (xtrabackup --prepare --target-dir=/path/to/backup-dir)
    - if prepare is successful, you can either copy the files to the datadir manually or use the --copy-back option
    - change file ownership (chown -R mysql:mysql /var/lib/mysql)
    - start mysql

    You can restore the backups on the original server or the replacement server, either way should work.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.