create database if not exists test; use test; drop table if exists t1; CREATE TABLE t1 (i int) ENGINE = InnoDB PARTITION BY KEY (i) PARTITIONS 3; # https://dev.mysql.com/doc/refman/8.0/en/tablespace-copying.html #### 8.0.13 -> 8.0.15 - no issues observed -- rm -rf 94850_8_0_13 bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/94850_8_0_13 --log-error-verbosity=3 bin/mysqld --basedir=$PWD --datadir=$PWD/94850_8_0_13 --core-file --socket=/tmp/mysql_8013.sock --port=3333 --log-error=$PWD/94850_8_0_13/log.err --log-error-verbosity=3 2>&1 & (1)On the source instance, create a partitioned table if one does not exist. In the following example, a table with three partitions (p0, p1, p2) is created: bin/mysql -uroot -S /tmp/mysql_8013.sock --prompt='8_0_13>' Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.13 MySQL Community Server - GPL Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 8_0_13>create database if not exists test; Query OK, 1 row affected (0.07 sec) 8_0_13>use test; Database changed 8_0_13>drop table if exists t1; Query OK, 0 rows affected, 1 warning (0.00 sec) 8_0_13>CREATE TABLE t1 (i int) ENGINE = InnoDB PARTITION BY KEY (i) PARTITIONS 3; Query OK, 0 rows affected (0.01 sec) 8_0_13>\! ls -l 94850_8_0_13/test/ total 240 -rw-r----- 1 umshastr common 114688 Apr 4 13:55 t1#P#p0.ibd -rw-r----- 1 umshastr common 114688 Apr 4 13:55 t1#P#p1.ibd -rw-r----- 1 umshastr common 114688 Apr 4 13:55 t1#P#p2.ibd 8_0_13> - 8.0.15 rm -rf 94850_8_0_15 bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/94850_8_0_15 --log-error-verbosity=3 bin/mysqld --basedir=$PWD --datadir=$PWD/94850_8_0_15 --core-file --socket=/tmp/mysql_8015.sock --port=9999 --log-error=$PWD/94850_8_0_15/log.err --log-error-verbosity=3 2>&1 & (2) On the destination instance, create the same partitioned table: bin/mysql -uroot -S /tmp/mysql_8015.sock --prompt='8_0_15>' Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.15 MySQL Community Server - GPL Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 8_0_15>create database if not exists test; Query OK, 1 row affected (0.01 sec) 8_0_15>use test; Database changed 8_0_15>drop table if exists t1; Query OK, 0 rows affected, 1 warning (0.01 sec) 8_0_15>CREATE TABLE t1 (i int) ENGINE = InnoDB PARTITION BY KEY (i) PARTITIONS 3; Query OK, 0 rows affected (0.01 sec) 8_0_15>\! ls -l 94850_8_0_15/test/ total 240 -rw-r----- 1 umshastr common 114688 Apr 4 13:56 t1#P#p0.ibd -rw-r----- 1 umshastr common 114688 Apr 4 13:56 t1#P#p1.ibd -rw-r----- 1 umshastr common 114688 Apr 4 13:56 t1#P#p2.ibd 8_0_15> 8_0_15> (3) On the destination instance, discard the tablespace for the partitioned table. (Before the tablespace can be imported on the destination instance, the tablespace that is attached to the receiving table must be discarded.) 8_0_15>ALTER TABLE t1 DISCARD TABLESPACE; Query OK, 0 rows affected (0.01 sec) 8_0_15> (4) On the source instance, run FLUSH TABLES ... FOR EXPORT to quiesce the partitioned table and create the .cfg metadata files: 8_0_13>FLUSH TABLES t1 FOR EXPORT; Query OK, 0 rows affected (0.01 sec) 8_0_13>\! ls -l 94850_8_0_13/test/ total 252 -rw-r----- 1 umshastr common 576 Apr 4 13:59 t1#P#p0.cfg -rw-r----- 1 umshastr common 114688 Apr 4 13:55 t1#P#p0.ibd -rw-r----- 1 umshastr common 576 Apr 4 13:59 t1#P#p1.cfg -rw-r----- 1 umshastr common 114688 Apr 4 13:55 t1#P#p1.ibd -rw-r----- 1 umshastr common 576 Apr 4 13:59 t1#P#p2.cfg -rw-r----- 1 umshastr common 114688 Apr 4 13:55 t1#P#p2.ibd 8_0_13> (5) Copy the .ibd and .cfg files from the source instance database directory to the destination instance database directory. For example: 8_0_13>\! cp 94850_8_0_13/test/t1*.{ibd,cfg} /export/umesh/server/binaries/GABuilds/mysql-8.0.15-linux-glibc2.12-x86_64/94850_8_0_15/test 8_0_13> 8_0_13> (6) On the source instance, use UNLOCK TABLES to release the locks acquired by FLUSH TABLES ... FOR EXPORT: 8_0_13> 8_0_13>UNLOCK TABLES; Query OK, 0 rows affected (0.00 sec) 8_0_13> (7) On the destination instance, import the tablespace for the partitioned table: 8_0_15>ALTER TABLE t1 IMPORT TABLESPACE; Query OK, 0 rows affected (0.04 sec) 8_0_15> #### 8.0.14 -> 8.0.15 - no issues observed - rm -rf 94850_8_0_14 bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/94850_8_0_14 --log-error-verbosity=3 bin/mysqld --basedir=$PWD --datadir=$PWD/94850_8_0_14 --core-file --socket=/tmp/mysql_8014.sock --port=3333 --log-error=$PWD/94850_8_0_14/log.err --log-error-verbosity=3 2>&1 & (1)On the source instance, create a partitioned table if one does not exist. In the following example, a table with three partitions (p0, p1, p2) is created: bin/mysql -uroot -S /tmp/mysql_8014.sock --prompt='8_0_14>' Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.14 MySQL Community Server - GPL Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 8_0_14>create database if not exists test; Query OK, 1 row affected (0.00 sec) 8_0_14>use test; Database changed 8_0_14>drop table if exists t1; Query OK, 0 rows affected, 1 warning (0.00 sec) 8_0_14>CREATE TABLE t1 (i int) ENGINE = InnoDB PARTITION BY KEY (i) PARTITIONS 3; Query OK, 0 rows affected (0.02 sec) 8_0_14>\! ls -l 94850_8_0_14/test/ total 240 -rw-r----- 1 umshastr common 114688 Apr 4 14:08 t1#P#p0.ibd -rw-r----- 1 umshastr common 114688 Apr 4 14:08 t1#P#p1.ibd -rw-r----- 1 umshastr common 114688 Apr 4 14:08 t1#P#p2.ibd 8_0_14> - rm -rf 94850_8_0_15 bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/94850_8_0_15 --log-error-verbosity=3 bin/mysqld --basedir=$PWD --datadir=$PWD/94850_8_0_15 --core-file --socket=/tmp/mysql_8015.sock --port=9999 --log-error=$PWD/94850_8_0_15/log.err --log-error-verbosity=3 2>&1 & (2) On the destination instance, create the same partitioned table: bin/mysql -uroot -S /tmp/mysql_8015.sock --prompt='8_0_15>' Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.15 MySQL Community Server - GPL Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 8_0_15>create database if not exists test; Query OK, 1 row affected (0.01 sec) 8_0_15>use test; Database changed 8_0_15>drop table if exists t1; Query OK, 0 rows affected, 1 warning (0.00 sec) 8_0_15>CREATE TABLE t1 (i int) ENGINE = InnoDB PARTITION BY KEY (i) PARTITIONS 3; Query OK, 0 rows affected (0.01 sec) 8_0_15>\! ls -l 94850_8_0_15/test/ total 240 -rw-r----- 1 umshastr common 114688 Apr 4 14:09 t1#P#p0.ibd -rw-r----- 1 umshastr common 114688 Apr 4 14:09 t1#P#p1.ibd -rw-r----- 1 umshastr common 114688 Apr 4 14:09 t1#P#p2.ibd 8_0_15> (3) On the destination instance, discard the tablespace for the partitioned table. (Before the tablespace can be imported on the destination instance, the tablespace that is attached to the receiving table must be discarded.) 8_0_15>ALTER TABLE t1 DISCARD TABLESPACE; Query OK, 0 rows affected (0.01 sec) 8_0_15> (4) On the source instance, run FLUSH TABLES ... FOR EXPORT to quiesce the partitioned table and create the .cfg metadata files: 8_0_14> 8_0_14>FLUSH TABLES t1 FOR EXPORT; Query OK, 0 rows affected (0.01 sec) 8_0_14>\! ls -l 94850_8_0_14/test/ total 252 -rw-r----- 1 umshastr common 576 Apr 4 14:10 t1#P#p0.cfg -rw-r----- 1 umshastr common 114688 Apr 4 14:08 t1#P#p0.ibd -rw-r----- 1 umshastr common 576 Apr 4 14:10 t1#P#p1.cfg -rw-r----- 1 umshastr common 114688 Apr 4 14:08 t1#P#p1.ibd -rw-r----- 1 umshastr common 576 Apr 4 14:10 t1#P#p2.cfg -rw-r----- 1 umshastr common 114688 Apr 4 14:08 t1#P#p2.ibd 8_0_14> (5) Copy the .ibd and .cfg files from the source instance database directory to the destination instance database directory. For example: 8_0_14>\! cp 94850_8_0_14/test/t1*.{ibd,cfg} /export/umesh/server/binaries/GABuilds/mysql-8.0.15-linux-glibc2.12-x86_64/94850_8_0_15/test 8_0_14> (6) On the source instance, use UNLOCK TABLES to release the locks acquired by FLUSH TABLES ... FOR EXPORT: 8_0_14> 8_0_14>UNLOCK TABLES; Query OK, 0 rows affected (0.00 sec) 8_0_14> (7) On the destination instance, import the tablespace for the partitioned table: 8_0_15>ALTER TABLE t1 IMPORT TABLESPACE; Query OK, 0 rows affected (0.11 sec) 8_0_15>