+1-208-473-2904 (USA - Sales)
0-800-051-8984 (UK - Sales)
0-800-181-0665 (GER - Sales)
+1-925-271-5054 (Training)
In InnoDB versions prior to 5.6, it is not possible to copy tables between servers by copying the files, even with innodb_file_per_table. However, with the xtrabackup binary, you can export individual tables from any InnoDB database, and import them into Percona Server with XtraDB or MySQL 5.6. (The source doesn’t have to be XtraDB or or MySQL 5.6, but the destination does.) This functionality requires innodb_file_per_table to be used on both servers, and requires innodb_expand_import to be enabled on the destination server. It only works on individual .ibd files, and cannot export a table that is not contained in its own .ibd file.
Let’s see how to export and import the following table:
CREATE TABLE export_test (
a int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
This table should have been created in innodb_file_per_table mode, so after taking a backup as usual with --backup, the .ibd file should exist in the target directory:
$ find /data/backups/mysql/ -name export_test.*
/data/backups/mysql/test/export_test.ibd
when you prepare the backup, add the extra parameter --export to the command. Here is an example:
$ xtrabackup --prepare --export --target-dir=/data/backups/mysql/
Now you should see a .exp file in the target directory:
$ find /data/backups/mysql/ -name export_test.*
/data/backups/mysql/test/export_test.exp
/data/backups/mysql/test/export_test.ibd
/data/backups/mysql/test/export_test.cfg
These three files are all you need to import the table into a server running Percona Server with XtraDB or MySQL 5.6.
On the destination server running Percona Server with XtraDB and innodb_expand_import option enabled, or MySQL 5.6, create a table with the same structure, and then perform the following steps:
The table should now be imported, and you should be able to SELECT from it and see the imported data.