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

**URL:** <https://forums.percona.com/t/concept-migrate-from-mysql-5-7-to-percona-distribution-for-mysql-8/9663>\
**Category:** Percona Distribution for MySQL\
**Created:** [March 15, 2021, 6:07pm UTC](https://forums.percona.com/t/concept-migrate-from-mysql-5-7-to-percona-distribution-for-mysql-8/9663 "2021-03-15T18:07:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seb](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Seb](https://forums.percona.com/u/Seb)\
**Post date:** [March 15, 2021, 6:07pm UTC](https://forums.percona.com/t/concept-migrate-from-mysql-5-7-to-percona-distribution-for-mysql-8/9663/1 "2021-03-15T18:07:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [March 15, 2021, 7:56pm UTC](https://forums.percona.com/t/concept-migrate-from-mysql-5-7-to-percona-distribution-for-mysql-8/9663/2 "2021-03-15T19:56:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Seb](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Seb](https://forums.percona.com/u/Seb)\
**Post date:** [March 16, 2021, 8:04am UTC](https://forums.percona.com/t/concept-migrate-from-mysql-5-7-to-percona-distribution-for-mysql-8/9663/3 "2021-03-16T08:04:44Z")

</div>

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](https://www.percona.com/doc/percona-xtrabackup/2.4/index.html) (v2.4)  
> _Percona XtraBackup_ 2.4 does not support making backups of databases created in _MySQL_ 8.0

> [Percona XtraBackup](https://www.percona.com/doc/percona-xtrabackup/LATEST/index.html) (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?

---

<div class="post-metadata">

**Author:** ![vadimtk](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadimtk/32/9528_2.png) [@vadimtk](https://forums.percona.com/u/vadimtk)\
**Post date:** [March 16, 2021, 11:17am UTC](https://forums.percona.com/t/concept-migrate-from-mysql-5-7-to-percona-distribution-for-mysql-8/9663/4 "2021-03-16T11:17:13Z")

</div>

@Seb

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

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [March 16, 2021, 2:04pm UTC](https://forums.percona.com/t/concept-migrate-from-mysql-5-7-to-percona-distribution-for-mysql-8/9663/5 "2021-03-16T14:04:25Z")

</div>

> [@Seb](#):
>
> i will need to lock the master

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

---

<div class="post-metadata">

**Author:** ![Seb](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Seb](https://forums.percona.com/u/Seb)\
**Post date:** [March 16, 2021, 2:33pm UTC](https://forums.percona.com/t/concept-migrate-from-mysql-5-7-to-percona-distribution-for-mysql-8/9663/6 "2021-03-16T14:33:42Z")

</div>

@vadimtk @matthewb

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