Concept: Migrate from MySQL 5.7 to Percona Distribution for MySQL 8

Extended Hello!

I have a question regarding the migration of our databases
I want to migrate from MySQL 5.7 to Percona 8.
In production we want a downtime as low as possible and i am unsure which way to choose.

Here the options i see right now

  1. Percona XtraBackup, not possible as it only supports MySQL from version 8

  2. Dump everything via MySQL dump and import the dump into a new Percona installation. This would take a few hours.

  3. Set up new Percona installation as slave to MySQL 5.7 Server, Lock MySQL 5.7 and let Percona catch up. I am not sure if Percona can be a Slave to MySQL 5.7

Would be thankful for suggestions

Thank you & Regards

1 Like

Hello @Seb,

  1. Percona XtraBackup supports every version of MySQL going back to 5.5. Where did you read this that PXB only supports v8?
  2. Correct. I suggest using mydumper/myloader instead as they are parallel in nature while mysqldump is not
  3. Every newer version of MySQL is always backwards compatible via replication. Absolutely, a MySQL 8 can be a replica of a 5.7 source.

#3 is actually the best way to do this. Create a new MySQL server, install Percona MySQL 8, take a backup of your existing 5.7 using PXB, restore to new server, configure new as replica of 5.7 server, wait for catch up. Once catch up is done, set 5.7 to super_read_only=1, migrate applications to use v8 server, then shut down 5.7.

1 Like

Hello @matthewb,

Thank you for your answer!

Regarding 1: My bad, you are right. I need to use Percona XtraBackup 2.4 for MySQL 5.7.

Percona XtraBackup - Documentation (v2.4)
Percona XtraBackup 2.4 does not support making backups of databases created in MySQL 8.0

Percona XtraBackup - Documentation (v8)
Percona XtraBackup 8.0 does not support making backups of databases created in versions prior to 8.0 of MySQL

When doing a backup with Percona XtraBackup 2.4 will the backup be compatible with Percona 8?

I will then initially copy the data to Percona 8 and set up a replication and switch like descibed.

When creating the initial copy with Percona XtraBackup or mydumper i will need to lock the master and get the binlog positon as usual, right?

1 Like


XtraBackup 2.4 will make copy of 5.7 data, but then you can start 8.0 server over that data directory,
the server will perform upgrade procedures in-place (after this you won’t be able to start 5.7 over that directory)

With XtraBackup you do not need to lock master for binary log positions, it will perform for you automatically trying to minimize the impact from locking

1 Like

You do not need to lock the master when using xtrabackup. The binlog position can be found after the backup is complete, in the file xtraback_binlog_pos

1 Like

@vadimtk @matthewb

Thank you for your helpful answers!
I will do it that way

1 Like