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

Restoration when running of out space

jeanclumejeanclume EntrantCurrent User Role Beginner
Hello,
i'm a happy xtrabackup user with a fast growing database.
I have a question when you want to save some disk space when restoring your xtrabackup.
If i restore my backup and prepare it directly to my DB datadir and then set the appropriate rights i think i won't have to use the --copy-back option of innobackupex?
While doing so i can save disk space because you don't have to store the restored backup elsewhere then copy it to the datadir.
What is the purpose of --copy-back except just copying the files to the datadir?
Do you see any drawbacks using my method?
Thanks.

PS: my db is innodb only

Comments

  • mirfanmirfan Database Administrator Inactive User Role Beginner
    If i restore my backup and prepare it directly to my DB datadir and then set the appropriate rights i think i won't have to use the --copy-back option of innobackupex?
    Yes, you can copy backup directory directly to target server datadir and prepare it there but make sure data directory is empty where you are restoring and mysql server is stopped on target server. Also, you can prepare a backup created with older Percona XtraBackup version with a newer one, but not vice versa. Once your backup is prepared, you can apply proper permissions to data directory and restart mysql service.

    What is the purpose of --copy-back except just copying the files to the datadir?
    Xtrabackup --copy-back option copies/restore the backup to target server data directory. It will copy all the data related files as per my.cnf. WIth, --copy-back option you don't need to manually copy/move files. If you don't want to use --copy-back option you can use method you described via mv, cp or rsync.

    You can read details in documentation.
    https://www.percona.com/doc/percona-xtrabackup/2.3/backup_scenarios/full_backup.html#preparing-a-backup
    https://www.percona.com/doc/percona-xtrabackup/2.3/innobackupex/restoring_a_backup_ibk.html
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.