# transfer a DB size 6GB

**URL:** <https://forums.percona.com/t/transfer-a-db-size-6gb/7879>\
**Category:** Percona XtraDB Cluster 8.x\
**Tags:** community, mysql, percona\
**Created:** [August 10, 2020, 8:23pm UTC](https://forums.percona.com/t/transfer-a-db-size-6gb/7879 "2020-08-10T20:23:50Z")\
**Posts on this page:** 9\
**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 10, 2020, 8:23pm UTC](https://forums.percona.com/t/transfer-a-db-size-6gb/7879/1 "2020-08-10T20:23:50Z")

</div>

hi experts,  
  
I am new to percona xtraDB cluster and i just know mysqldump export and import for MySQL.  
  
if we need to transfer 6TB of data from percona xtradB cluster 5.7.x to 8.0.19, what is the best method of that ?  
  
any practical URL for it?

---

<div class="post-metadata">

**Author:** ![vinicius.grippa](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vinicius.grippa/32/1246_2.png) [@vinicius.grippa](https://forums.percona.com/u/vinicius.grippa)\
**Post date:** [August 11, 2020, 8:28pm UTC](https://forums.percona.com/t/transfer-a-db-size-6gb/7879/2 "2020-08-11T20:28:01Z")

</div>

The golden rule is test everything before going to production. Validate all steps in a test environment and in case something goes wrong you can destroy it.  
The steps are documented here:  
[https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/upgrade\_guide.html](https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/upgrade_guide.html)

---

<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 12, 2020, 1:26am UTC](https://forums.percona.com/t/transfer-a-db-size-6gb/7879/3 "2020-08-12T01:26:03Z")

</div>

sorry it is not an upgrade by migration…  
need to copy all existing data to target server.

---

<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/transfer-a-db-size-6gb/7879/4 "2020-08-20T23:22:19Z")

</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:** ![vinicius.grippa](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vinicius.grippa/32/1246_2.png) [@vinicius.grippa](https://forums.percona.com/u/vinicius.grippa)\
**Post date:** [August 22, 2020, 9:45am UTC](https://forums.percona.com/t/transfer-a-db-size-6gb/7879/5 "2020-08-22T09:45:49Z")

</div>

You can use xtrabackup to backup and restore on the destination and then perform the in-place upgrade to 8.0.19. It should be faster than mysqldump.  
  
If you want to go with a logical dump, I recommend using mydumper and myloader which provides parallel processing.

---

<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 23, 2020, 10:46pm UTC](https://forums.percona.com/t/transfer-a-db-size-6gb/7879/6 "2020-08-23T22:46:18Z")

</div>

“You can use xtrabackup to backup and restore on the destination and then perform the in-place upgrade to 8.0.19. It should be faster than mysqldump.”  
what is the full command line to do it ?  
  
As we will use more from mysql 5.7.23 on redhat 6.x to CentOS 8, so do you think MySQL 5.7.23 has a version on CentOS 8 ?  
and you mean install Mysql 5.7.23 on both side, then just use xtrabackup to backup and restore (then why don’t we just use rsync to copy the whole data directory to the same path on target linux box and start the target mysql 5.7.23 on CentOS 8) to the target MySQL 5.7.23 on CentOS 8, then in place upgrade the new installed 5.7.23 on CentOS 8 ?  
  
“If you want to go with a logical dump, I recommend using mydumper and myloader which provides parallel processing.”  
  
how to do it in command line, please share URL .

---

<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 27, 2020, 10:57pm UTC](https://forums.percona.com/t/transfer-a-db-size-6gb/7879/7 "2020-08-27T22:57:13Z")

</div>

hi,  
any udpate for me ?  
“I recommend using mydumper and myloader which provides parallel processing.”  
both tools included in the PXC installation? what is the full command for it if I ONLY want to backup:  
1) table schema, index, primary and foreign key ?  
2) DB logic, SP, view, function and trigger.  
3) data.  
  
and also how can I do compressed backup using xtraDB Backup&nbsp; on 1) and 2) and 3 ) ?

---

<div class="post-metadata">

**Author:** ![vinicius.grippa](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vinicius.grippa/32/1246_2.png) [@vinicius.grippa](https://forums.percona.com/u/vinicius.grippa)\
**Post date:** [August 30, 2020, 9:36am UTC](https://forums.percona.com/t/transfer-a-db-size-6gb/7879/8 "2020-08-30T09:36:38Z")

</div>

Using Xtrabackup will backup the database at physical level and you do not have a way to execute only for options 1,2 and 3.  
If you want to split by these options you can use traditional mysqldump with the available options (–routines,&nbsp;–triggers and&nbsp;–no-data).&nbsp;  
For mydumper/myloader these are examples:

```auto
mydumper -B &lt;db-name&gt; --threads=50 --user=root --password=msandbox --host=127.0.0.1 --port=46008 --trx-consistency-only --events --routines --triggers --compress --outputdir /home/vinicius.grippa/sandboxes/backup/ --logfile /home/vinicius.grippa/sandboxes/mydumper.out --verbose=3

```

And:

```auto
&nbsp;myloader -B &lt;db-name&gt;&nbsp; --threads=50 --user=root --password=msandbox --host=127.0.0.1 --port=46008 --directory=/home/vinicius.grippa/sandboxes/backup/ --overwrite-tables --verbose 3

```

The mydumper/myloader are not part of Percona of the Percona Toolkit and you can download here:  
[https://github.com/maxbube/mydumper](https://github.com/maxbube/mydumper "Link: https://github.com/maxbube/mydumper")  
  
For Xtrabackup here is an example:

```auto
xtrabackup --defaults-file=my.sandbox.cnf -uroot -proot -H 127.0.0.1 -P 45007 --backup --parallel=4 --compress --compress-threads=2 --datadir=/var/lib/mysql --target-dir=./backup/&nbsp;

```

Again, these are examples of the commands and they may need to be changed according to your needs and hardware capacity.&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:** [September 14, 2020, 4:02am UTC](https://forums.percona.com/t/transfer-a-db-size-6gb/7879/9 "2020-09-14T04:02:57Z")

</div>

“–threads=50”  
This is for multi threading in mysqldump ?  
  
“mydumper -B \<db-name\> --threads=50 --user=root --password=msandbox --host=127.0.0.1 --port=46008 --trx-consistency-only --events --routines --triggers --compress --outputdir /home/vinicius.grippa/sandboxes/backup/ --logfile /home/vinicius.grippa/sandboxes/mydumper.out --verbose=3”  
  
sorry this seems backup everything?&nbsp; what if I want to backup   
1)ONLY backup table&nbsp;   
2) ONLY data   
3) MySQL logic only ?  
  
“myloader -B \<db-name\>&nbsp; --threads=50 --user=root --password=msandbox --host=127.0.0.1 --port=46008 --directory=/home/vinicius.grippa/sandboxes/backup/ --overwrite-tables --verbose 3”  
  
what is the different between myloader and mysqldump?
