What reason to store binlog files to xtrabackup backup

Hello

There are two files in xtrabackup backup:
mysql-bin.002103
mysql-bin.index

What reason xtrabackup store them in backup?
Is it safe to delete them? If not, why?

My Mysql binlog directory not same, as database path. Should I move thise files to binlog directory during restore if I didnt use copy-back/move-back but manually copy backup to mysql directory?

Welcome to Percona Forums @yuskovich_alexey,

To start with I’d encourage you to read How Percona XtraBackup works - Percona XtraBackup.

Now to answer your questions:

What reason xtrabackup store them in backup?

  • Xtrabackup fetches active binlog and binlog index file to provide you with possible replication setup further.
  • Xtrabackup provides you with the coordinates for the backup for replication setup (both backup host and its source). You can review xtrabackup logs to understand at what stage it writes this.
  • If binlogs are not enabled obviously it will not fetch/write them.

Is it safe to delete them? If not, why?

  • yes, if you don’t want to work on replication / use of binlogs for that matter

My Mysql binlog directory not same

  • yes as long as you have configured this in my.cnf after move-back you can move your files to appropriate directory, ensure permissions and start

Thanks,
K

PS: You might want to read Quick Look – MySQL Data Directory Files | Change Is Inevitable

1 Like