# percona xtraDB cluster migration from 5.7 to 8.0.19

**URL:** <https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864>\
**Category:** Percona XtraDB Cluster 8.x\
**Tags:** community, mysql, percona\
**Created:** [August 7, 2020, 4:09am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864 "2020-08-07T04:09:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 7, 2020, 4:09am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/1 "2020-08-07T04:09:02Z")

</div>

&nbsp;I checked a lot of articles on how to migration from percona xtraDB cluster 5.7.x on one box to another box running percona xtraDB cluster 8.0.19, but one thing never mention, can I just&nbsp;  
1) add 1 new built percona xtraDB cluster 8.0.19 nodes to existing xtraDB cluster 5.7 and let replication take care of all data/table schema, mysql logic/code to the 8.0.19 nodes, once it is done we take that 8.0.19 nodes&nbsp;out of the xtraDB cluster 5.7 pool&nbsp;  
2) In the&nbsp;grastate.dat of the&nbsp;8.0.19 nodes,&nbsp;make the&nbsp;safe\_to\_bootstrap = 1&nbsp;  
3) bootstrap that&nbsp;8.0.19 nodes to form the first node of a new cluster.  
4) let the rest of the other&nbsp;8.0.19 nodes join this new cluster.  
  
is it going to work ? can&nbsp;8.0.19 nodes join&nbsp;existing xtraDB cluster 5.7 pool?

---

<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:** [August 7, 2020, 5:01am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/2 "2020-08-07T05:01:23Z")

</div>

From our upgrade guide:  
[Redirecting](https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/upgrade_guide.html#not-recommended-to-mix-pxc-5-7-nodes-with-pxc-8-0-nodes)  
Not recommended to mix Percona XtraDB Cluster 5.7 nodes with Percona XtraDB Cluster 8.0 nodesShut down the cluster and upgrade each node to Percona XtraDB Cluster 8.0. It is important that you make backups before attempting an upgrade.

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 7, 2020, 5:18am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/3 "2020-08-07T05:18:43Z")

</div>

it will be different host, so it will be a migration project instead of upgrade. any idea on what is the best way to migration ALL data and mySQL logic from percona xtraDB cluster 5.7 to percona xtraDB cluster 8.019?  
  
can mysqlo workbench has this feature to migrate data for us ?

---

<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:** [August 7, 2020, 5:21am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/4 "2020-08-07T05:21:05Z")

</div>

You can do it in the following steps:  
-copy data with xtrabackup to the new host  
-start new single node XtraDB Cluster 8.0 on that new host  
-add more nodes to the new established cluster, one-by-one. The data will be copied automatically to the new nodes.

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 7, 2020, 5:23am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/5 "2020-08-07T05:23:28Z")

</div>

hi,  
  
tks.  
“-copy data with xtrabackup to the new host”  
how ? any full command line for me ? mysqldump can also do the job&nbsp; ?  
“-start new single node XtraDB Cluster 8.0 on that new host”  
bootstrap that node as the primary node of the new percona xtraDB cluster 8.0.19 ?  
then add other slave node one by one .

---

<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:** [August 7, 2020, 5:31am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/6 "2020-08-07T05:31:04Z")

</div>

For XtraBackup guide please check  
[https://www.percona.com/doc/percona-xtrabackup/8.0/backup\_scenarios/full\_backup.html](https://www.percona.com/doc/percona-xtrabackup/8.0/backup_scenarios/full_backup.html)  
You also can use mysqldump if you are more familiar with this tool.  
“bootstrap that node as the primary node of the new percona xtraDB cluster 8.0.19 ?” - yes this is correct.

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 7, 2020, 6:01am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/7 "2020-08-07T06:01:48Z")

</div>

hi,  
tks.  
so this is what we need:  
-copy data with xtrabackup /mysqldump to the new host  
-start new single node XtraDB Cluster 8.0 on that new host  
-add more nodes to the new established cluster, one-by-one. The data will be copied automatically to the new nodes.  
  
xtrabackup backup user account and password too ?  
  
and under what situation must we do:  
1)&nbsp;The&nbsp;util.checkForServerUpgrade()  
2)&nbsp;mysqlcheck -u root -p --all-databases --check-upgrade  
  
are they the same thing ? MySQL shell has to be install on both case before it works or only 1) ?

---

<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:** [August 7, 2020, 6:14am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/8 "2020-08-07T06:14:23Z")

</div>

Percona XtraDB Cluster 8.0 will perform auto-upgrade when it detects data from 5.7. You do not need MySQL shell and mysqlcheck commands.

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 7, 2020, 6:17am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/9 "2020-08-07T06:17:39Z")

</div>

“You do not need MySQL shell and mysqlcheck commands.”  
but there will be imcompatible between version, right ? you know from 8.0.16 to 8.0.18 mysql\_upgrade is need once uninstall 8.0.16 and install with 8.0.18, however from 5.7 to 8.0.19 it is a big jump, still no need to run&nbsp;&nbsp;util.checkForServerUpgrade() and&nbsp;mysqlcheck?&nbsp; just backup and restore to the new version the restore process will take care everything ?  
  
if it is true and mysqldump AND/OR xtabackup can handle it for us, are we going to upgrade the xtrabackup on xtraDB cluster 5.7 nodes to the same version as the new 8.0.19 nodes first then backup from 5.7 nodes and restore to 8.0.19 nodes?

---

<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:** [August 7, 2020, 6:37am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/10 "2020-08-07T06:37:34Z")

</div>

if you can handle your backup with mysqldump, it is probably the best course of action.  
In this case the flow is following:  
- make mysqldump from existing 5.7  
- start a new Percona XtraDB Cluster 8.0 node on the new emtpy data directory  
- restore mysqldump to the new cluster  
- add more nodes one-by-one

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 7, 2020, 7:38am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/11 "2020-08-07T07:38:06Z")

</div>

“if you can handle your backup with mysqldump, it is probably the best course of action”  
  
oh, surprise that it is even better than xtabackup, any reason for this?   
  
Can this command:  
mysqldump --host=\<DB host we want  
to back from \> --all-databases --events --routines --replace --master-data=2  
\> \<dump\_file.sql\>  
  
backup EVERTHING from old percona 5.7 using the mysqldump binary from 5.7 and when restore, using the mysqldump binary on percona 8.0.19 and restore good ?  
  
"&nbsp;start a new Percona XtraDB Cluster 8.0 node on the new empty data directory"  
  
why need empty data directory ? the cluster 8.0.19 will be empty at that moment, that’s why the above statement has&nbsp;–replace, will it be ok ?  
  
So workflow will be:  
1) on any percona cluster 5.7&nbsp;node,&nbsp;backup using mysqldump binary from percona cluster 5.7 to the .sql files,  
2) copy the .sql file to the first percona cluster 8.0.19 primay nodes.  
2)&nbsp; bootstrap the first percona cluster 8.0.19 primay nodes  
3) restore to the first percona cluster 8.0.19 primay nodes,&nbsp;using mysqldump binary on percona cluster 8.0.19 ,  
4) once complete just add slave nodes one by one.

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 7, 2020, 7:49am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/12 "2020-08-07T07:49:43Z")

</div>

"&nbsp;You do not need MySQL shell and mysqlcheck commands."  
just a quick question, if it is no need, why it release&nbsp; ? must having a&nbsp; purpose, 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:** [August 7, 2020, 11:45am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/13 "2020-08-07T11:45:54Z")

</div>

`oh, surprise that it is even better than xtabackup, any reason for this?`  
In this case it seems better because you are more familiar with mysqldump then with xtrabackup.  
From what I understand it will be easier for you to use the tool which you already used and not to learn xtrabackup.

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 8, 2020, 6:18am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/14 "2020-08-08T06:18:45Z")

</div>

“In this case it seems better because you are more familiar with mysqldump then with xtrabackup.”  
so using either one make no difference and either one can export and import all objects including username, password and MySQL code/logic from 5.7x to 8.0.19 ?  
  
So workflow will be :  
1) on any percona cluster 5.7&nbsp;node,&nbsp;backup using mysqldump binary from percona cluster 5.7 to the .sql files,  
2) copy the .sql file to the first percona cluster 8.0.19 primay nodes.  
2)&nbsp; bootstrap the first percona cluster 8.0.19 primay nodes  
3) restore to the first percona cluster 8.0.19 primay nodes,&nbsp;using mysqldump binary on percona cluster 8.0.19 ,  
4) once complete just add slave nodes one by one.

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 8, 2020, 6:19am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/15 "2020-08-08T06:19:54Z")

</div>

and backup is:  
  
mysqldump --host=\<DB host we want  
to back from \> --all-databases --events --routines --replace --master-data=2  
\> \<dump\_file.sql\>  
  
restore is:  
  
mysql --host=\<DB host we want to  
restore to \> -u root -p \< \<dump\_file.sql\>&nbsp;  
  
?

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 9, 2020, 2:02am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/16 "2020-08-09T02:02:49Z")

</div>

and I am not sure if&nbsp;–master-data=2 is necessary? for full DB backup and restore is it making any sense?

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 9, 2020, 7:35am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/17 "2020-08-09T07:35:43Z")

</div>

when I read xtraDB backup I read this too:

[https://www.percona.com/doc/percona-xtrabackup/8.0/backup\_scenarios/full\_backup.html](https://www.percona.com/doc/percona-xtrabackup/8.0/backup_scenarios/full_backup.html "Link: https://www.percona.com/doc/percona-xtrabackup/8.0/backup\_scenarios/full\_backup.html")

[https://www.percona.com/doc/percona-xtrabackup/2.3/xbstream/xbstream.html](https://www.percona.com/doc/percona-xtrabackup/2.3/xbstream/xbstream.html "Link: https://www.percona.com/doc/percona-xtrabackup/2.3/xbstream/xbstream.html")

[https://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/innobackupex\_script.html](https://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/innobackupex_script.html "Link: https://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/innobackupex\_script.html")

[https://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/preparing\_a\_backup\_ibk.html](https://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/preparing_a_backup_ibk.html "Link: https://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/preparing\_a\_backup\_ibk.html")

&nbsp;Restore:

[https://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/restoring\_a\_backup\_ibk.html](https://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/restoring_a_backup_ibk.html "Link: https://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/restoring\_a\_backup\_ibk.html")

why we need xbstream and innobackupex to do xtrabackup ?

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 20, 2020, 11:22pm UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/18 "2020-08-20T23:22:23Z")

</div>

sir, what is the data migration size is 6TB, using mysqldump to backup from Percona XtraDB cluster 5.7.x and restore to 8.0.19 still the best method ?

---

<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:** [August 21, 2020, 5:02am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/19 "2020-08-21T05:02:32Z")

</div>

6TB is a significant size. For this size I would use xtrabackup. But you also need a fast network and a fast storage, otherwise it will be very slow.

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 28, 2020, 1:18am UTC](https://forums.percona.com/t/percona-xtradb-cluster-migration-from-5-7-to-8-0-19/7864/20 "2020-08-28T01:18:20Z")

</div>

I check some xtrabackup command ,what is it for ?

xbstream&nbsp;-x \<&nbsp;\<backup&nbsp;file name\>&nbsp;&nbsp;-C /fmkdb\_backup\_dc2/restore&nbsp;

&nbsp;

for example&nbsp;

&nbsp;

&nbsp; xbstream&nbsp;-x \< fmkdb\_backup\_dc2/backup/Backupfmklog\_20190820.xbstream&nbsp;-C /fmkdb\_backup\_dc2/restore&nbsp;

&nbsp;

&nbsp; innobackupex&nbsp;–decompress /fmkdb\_innobackupex&nbsp;–apply-log /fmkdb\_backup\_dc2/restorebackup\_dc2/restore/&nbsp;

innobackupex&nbsp;–apply-log /path/to/BACKUP-DIR

?

I just want to know how to backup the following using xtrabackup:

1) backup only table schema, index, primary and foreign key, constraint of all DB from 5.7 to 8.0.19

2) backup only mysql logic of all DB : view, function, SP, etc.&nbsp; from 5.7 to 8.0.19

3) backup only data of all DB from 5.7 to 8.0.19
