Merge lp:~hrvojem/percona-xtrabackup/bug1222818-2.0 into lp:percona-xtrabackup/2.0

Proposed by Hrvoje Matijakovic
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 589
Proposed branch: lp:~hrvojem/percona-xtrabackup/bug1222818-2.0
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 260 lines (+54/-31)
11 files modified
doc/source/faq.rst (+5/-0)
doc/source/glossary.rst (+1/-1)
doc/source/howtos/recipes_ibkx_partition.rst (+4/-3)
doc/source/index.rst (+3/-3)
doc/source/innobackupex/innobackupex_script.rst (+1/-1)
doc/source/innobackupex/partial_backups_innobackupex.rst (+3/-3)
doc/source/innobackupex/restoring_individual_tables_ibk.rst (+24/-11)
doc/source/percona-theme/layout.html (+1/-1)
doc/source/xtrabackup_bin/restoring_individual_tables.rst (+10/-6)
doc/source/xtrabackup_bin/xbk_option_reference.rst (+1/-1)
doc/source/xtrabackup_bin/xtrabackup_binary.rst (+1/-1)
To merge this branch: bzr merge lp:~hrvojem/percona-xtrabackup/bug1222818-2.0
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+194349@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Hrvoje,

1. This text is a bit misleading:

"When :doc:`restoring individual tables
<xtrabackup_bin/restoring_individual_tables>` with |Percona XtraBackup|,
it creates a file with ``.exp`` extension per exported table containing
the information for importing it"

I suggest something along the following lines:

"Files with the ``.exp`` extension are created by |Percona XtraBackup|
per each InnoDB tablespace when the --export option is used on
prepare. These files can be used to import those tablespaces on Percona
Server 5.5 or lower versions, see :doc:`restoring individual tables
<xtrabackup_bin/restoring_individual_tables>`"

2. Strictly speaking, a .cfg file is _not_ required to import a
tablespace to MySQL 5.6 or Percona Server 5.6. A tablespace will be
imported successfully even if it is from another server, but InnoDB will
do schema validation if the corresponding .cfg file is present in the
same directory.

3. “In |InnoDB| versions prior to 5.6” -> “In server versions...”?

4. “However, with the |xtrabackup| binary” – you don’t necessarily have
to use the xtrabackup binary, “innobackupex --apply-log --export” will
work as well. Can we just say “with Percona XtraBackup” in both
innobackupex and xtrabackup sections?

5. We should make it clear that innodb_import_table_from_xtrabackup is
only required when importing a table to Percona Server version 5.5 or
lower. Which we do in the following note, but that means the following
text can be removed from preceding paragraph: “... and requires
`innodb_import_table_from_xtrabackup
<http://www.percona.com/doc/percona-server/5.5/management/innodb_expand_import.html#innodb_import_table_from_xtrabackup>`_
to be enabled on the destination server”

review: Needs Fixing
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'doc/source/faq.rst'
--- doc/source/faq.rst 2013-08-30 08:52:03 +0000
+++ doc/source/faq.rst 2013-11-14 12:32:00 +0000
@@ -55,3 +55,8 @@
55============================================================================================55============================================================================================
5656
57In case the ibdata and ib_log files are located in different directories outside of the datadir, you will have to put them in their proper place after the logs have been applied.57In case the ibdata and ib_log files are located in different directories outside of the datadir, you will have to put them in their proper place after the logs have been applied.
58
59Backup fails with Error 24: 'Too many open files'
60=================================================
61
62This usually happens when database being backed up contains large amount of files and |Percona XtraBackup| can't open all of them to create a successful backup. In order to avoid this error the operating system should be configured appropriately so that |Percona XtraBackup| can open all its files. On Linux, this can be done with the ``ulimit`` command for specific backup session or by editing the :file:`/etc/security/limits.conf` to change it globally (**NOTE**: the maximum possible value that can be set up is 1048576 which is a hard-coded constant in the Linux kernel).
5863
=== modified file 'doc/source/glossary.rst'
--- doc/source/glossary.rst 2013-08-30 08:52:03 +0000
+++ doc/source/glossary.rst 2013-11-14 12:32:00 +0000
@@ -88,7 +88,7 @@
88 Each |MyISAM| table has ``.MYI`` (MYIndex) file which contains the table's indexes.88 Each |MyISAM| table has ``.MYI`` (MYIndex) file which contains the table's indexes.
8989
90 .exp90 .exp
91 When :doc:`exporting a table <xtrabackup_bin/exporting_importing_tables>` with |Percona XtraBackup|, it creates a file with ``.exp`` extension per exported table containing the information for importing it.91 Files with the ``.exp`` extension are created by |Percona XtraBackup| per each |InnoDB| tablespace when the :option:`xtrabckup --export` option is used on prepare. These files can be used to import those tablespaces on |Percona Server| 5.5 or lower versions, see :doc:`restoring individual tables <xtrabackup_bin/restoring_individual_tables>`"
9292
93 .MRG93 .MRG
94 Each table using the :program:`MERGE` storage engine, besides of a :term:`.frm` file, will have :term:`.MRG` file containing the names of the |MyISAM| tables associated with it.94 Each table using the :program:`MERGE` storage engine, besides of a :term:`.frm` file, will have :term:`.MRG` file containing the names of the |MyISAM| tables associated with it.
9595
=== modified file 'doc/source/howtos/recipes_ibkx_partition.rst'
--- doc/source/howtos/recipes_ibkx_partition.rst 2013-08-30 08:52:03 +0000
+++ doc/source/howtos/recipes_ibkx_partition.rst 2013-11-14 12:32:00 +0000
@@ -36,7 +36,7 @@
36Preparing the backup36Preparing the backup
37=====================37=====================
3838
39For preparing partial backups, the procedure is analogous to :doc:`exporting tables <../innobackupex/importing_exporting_tables_ibk>` : apply the logs and use the :option:`--export` option::39For preparing partial backups, the procedure is analogous to :doc:`restoring individual tables <../innobackupex/restoring_individual_tables_ibk>` : apply the logs and use the :option:`--export` option::
4040
41 $ innobackupex --apply-log --export /mnt/backup/2012-08-28_10-29-0941 $ innobackupex --apply-log --export /mnt/backup/2012-08-28_10-29-09
4242
@@ -65,10 +65,11 @@
65Restoring from the backups65Restoring from the backups
66==========================66==========================
6767
68Restoring should be done by :doc:`importing the tables <../innobackupex/importing_exporting_tables_ibk>` in the partial backup to the server. 68Restoring should be done by :doc:`importing the tables <../innobackupex/restoring_individual_tables_ibk>` in the partial backup to the server.
6969
70.. note::70.. note::
71 Improved table/partition import is only available in |Percona Server|, this means that partitions which were backed up from different server can be imported as well. For |MySQL| only partitions from that server can be imported with some important limitations. There should be no DROP/CREATE/TRUNCATE/ALTER TABLE commands issued between taking the backup and importing the partition.71
72 Improved table/partition import is only available in |Percona Server| and |MySQL| 5.6, this means that partitions which were backed up from different server can be imported as well. For versions older than |MySQL| 5.6 only partitions from that server can be imported with some important limitations. There should be no DROP/CREATE/TRUNCATE/ALTER TABLE commands issued between taking the backup and importing the partition.
7273
73First step is to create new table in which data will be restored :: 74First step is to create new table in which data will be restored ::
7475
7576
=== modified file 'doc/source/index.rst'
--- doc/source/index.rst 2013-04-29 09:29:00 +0000
+++ doc/source/index.rst 2013-11-14 12:32:00 +0000
@@ -7,13 +7,13 @@
7 Percona Xtrabackup - Documentation7 Percona Xtrabackup - Documentation
8====================================8====================================
99
10*Percona* |XtraBackup| is an open-source hot backup utility for |MySQL| - based servers that doesn't lock your database during the backup.10|Percona XtraBackup| is an open-source hot backup utility for |MySQL| - based servers that doesn't lock your database during the backup.
1111
12It can back up data from |InnoDB|, |XtraDB|, and |MyISAM| tables on unmodified |MySQL| 5.0, 5.1, 5.5 and 5.6 servers, as well as |Percona Server| with |XtraDB|. For a high-level overview of many of its advanced features, including a feature comparison, please see :doc:`intro`.12It can back up data from |InnoDB|, |XtraDB|, and |MyISAM| tables on unmodified |MySQL| 5.0, 5.1, 5.5 and 5.6 servers, as well as |Percona Server| with |XtraDB|. For a high-level overview of many of its advanced features, including a feature comparison, please see :doc:`intro`.
1313
14Whether it is a 24x7 highly loaded server or a low-transaction-volume environment, *Percona* |XtraBackup| is designed to make backups a seamless procedure without disrupting the performance of the server in a production environment. `Commercial support contracts are available <http://www.percona.com/mysql-support/>`_.14Whether it is a 24x7 highly loaded server or a low-transaction-volume environment, |Percona XtraBackup| is designed to make backups a seamless procedure without disrupting the performance of the server in a production environment. `Commercial support contracts are available <http://www.percona.com/mysql-support/>`_.
1515
16*Percona* |XtraBackup| is a combination of the |xtrabackup| *C* program, and the |innobackupex| *Perl* script. The |xtrabackup| program copies and manipulates |InnoDB| and |XtraDB| data files, and the *Perl* script enables enhanced functionality, such as interacting with a running |MySQL| server and backing up |MyISAM| tables. 16|Percona XtraBackup| is a combination of the |xtrabackup| *C* program, and the |innobackupex| *Perl* script. The |xtrabackup| program copies and manipulates |InnoDB| and |XtraDB| data files, and the *Perl* script enables enhanced functionality, such as interacting with a running |MySQL| server and backing up |MyISAM| tables.
1717
18Introduction18Introduction
19============19============
2020
=== modified file 'doc/source/innobackupex/innobackupex_script.rst'
--- doc/source/innobackupex/innobackupex_script.rst 2013-04-29 09:29:00 +0000
+++ doc/source/innobackupex/innobackupex_script.rst 2013-11-14 12:32:00 +0000
@@ -47,7 +47,7 @@
47 parallel_copy_ibk47 parallel_copy_ibk
48 throttling_ibk48 throttling_ibk
49 remote_backups_ibk49 remote_backups_ibk
50 importing_exporting_tables_ibk50 restoring_individual_tables_ibk
51 pit_recovery_ibk51 pit_recovery_ibk
5252
5353
5454
=== modified file 'doc/source/innobackupex/partial_backups_innobackupex.rst'
--- doc/source/innobackupex/partial_backups_innobackupex.rst 2013-08-30 08:52:03 +0000
+++ doc/source/innobackupex/partial_backups_innobackupex.rst 2013-11-14 12:32:00 +0000
@@ -14,7 +14,7 @@
14Using the :option:`--include` option14Using the :option:`--include` option
15------------------------------------15------------------------------------
1616
17The regular expression provided to this will be matched against the fully qualified tablename, including the database name, in the form ``databasename.tablename``.17The regular expression provided to this will be matched against the fully qualified table name, including the database name, in the form ``databasename.tablename``.
1818
19For example, ::19For example, ::
2020
@@ -57,7 +57,7 @@
57Preparing Partial Backups57Preparing Partial Backups
58=========================58=========================
5959
60For preparing partial backups, the procedure is analogous to :doc:`exporting tables <importing_exporting_tables_ibk>` : apply the logs and use the :option:`--export` option::60For preparing partial backups, the procedure is analogous to :doc:`restoring individual tables <restoring_individual_tables_ibk>` : apply the logs and use the :option:`--export` option::
6161
62 $ innobackupex --apply-log --export /path/to/partial/backup62 $ innobackupex --apply-log --export /path/to/partial/backup
6363
@@ -84,7 +84,7 @@
84Restoring Partial Backups84Restoring Partial Backups
85=========================85=========================
8686
87Restoring should be done by :doc:`importing the tables <importing_exporting_tables_ibk>` in the partial backup to the server. 87Restoring should be done by :doc:`restoring individual tables <restoring_individual_tables_ibk>` in the partial backup to the server.
8888
89It can also be done by copying back the prepared backup to a "clean" :term:`datadir` (in that case, make sure to include the ``mysql`` database). System database can be created with: ::89It can also be done by copying back the prepared backup to a "clean" :term:`datadir` (in that case, make sure to include the ``mysql`` database). System database can be created with: ::
9090
9191
=== renamed file 'doc/source/innobackupex/importing_exporting_tables_ibk.rst' => 'doc/source/innobackupex/restoring_individual_tables_ibk.rst'
--- doc/source/innobackupex/importing_exporting_tables_ibk.rst 2013-03-19 15:21:27 +0000
+++ doc/source/innobackupex/restoring_individual_tables_ibk.rst 2013-11-14 12:32:00 +0000
@@ -1,14 +1,14 @@
1.. _imp_exp_ibk:1.. _imp_exp_ibk:
22
3===========================================3=============================
4 Importing and Exporting Individual Tables4 Restoring Individual Tables
5===========================================5=============================
66
7In standard |InnoDB|, it is not normally possible to copy tables between servers by copying the files, even with :term:`innodb_file_per_table` enabled. But |XtraBackup| allows to migrate individual table from any |InnoDB| database to |Percona Server| with |XtraDB|.7In server versions prior to 5.6, it is not possible to copy tables between servers by copying the files, even with :term:`innodb_file_per_table`. However, with the |Percona XtraBackup|, 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 only works on individual :term:`.ibd` files, and cannot export a table that is not contained in its own :term:`.ibd` file.
88
9The table is required to be created with the option :term:`innodb_file_per_table` enabled in the server, as exporting is only possible when table is stored in its own table space.9.. note::
1010
11The importing server (at the moment it only supported by |Percona Server|) should have :term:`innodb_file_per_table` and :term:`innodb_expand_import` options enabled.11 If you're running |Percona Server| version older than 5.5.10-20.1, variable `innodb_expand_import <http://www.percona.com/doc/percona-server/5.5/management/innodb_expand_import.html#innodb_expand_import>`_ should be used instead of `innodb_import_table_from_xtrabackup <http://www.percona.com/doc/percona-server/5.5/management/innodb_expand_import.html#innodb_import_table_from_xtrabackup>`_.
1212
13Exporting tables13Exporting tables
14================14================
@@ -25,7 +25,20 @@
25 `./mydatabase/mytable.exp` (1 indexes)25 `./mydatabase/mytable.exp` (1 indexes)
26 ..26 ..
2727
28Each :term:`.exp` file will be used for importing that table.28Now you should see a :term:`.exp` file in the target directory: ::
29
30 $ find /data/backups/mysql/ -name export_test.*
31 /data/backups/mysql/test/export_test.exp
32 /data/backups/mysql/test/export_test.ibd
33 /data/backups/mysql/test/export_test.cfg
34
35These three files are all you need to import the table into a server running |Percona Server| with |XtraDB| or |MySQL| 5.6.
36
37.. note::
38
39 |MySQL| uses ``.cfg`` file which contains |InnoDB| dictionary dump in special format. This format is different from the ``.exp`` one which is used in |XtraDB| for the same purpose. Strictly speaking, a ``.cfg`` file is **not** required to import a tablespace to |MySQL| 5.6 or |Percona Server| 5.6. A tablespace will be imported successfully even if it is from another server, but |InnoDB| will do schema validation if the corresponding ``.cfg`` file is present in the same directory.
40
41Each :term:`.exp` (or ``.cfg``) file will be used for importing that table.
2942
30.. note::43.. note::
3144
@@ -42,7 +55,7 @@
4255
43 OTHERSERVER|mysql> ALTER TABLE mydatabase.mytable DISCARD TABLESPACE;56 OTHERSERVER|mysql> ALTER TABLE mydatabase.mytable DISCARD TABLESPACE;
4457
45After this, copy :file:`mytable.ibd` and :file:`mytable.exp` files to database's home, and import its tablespace: ::58After this, copy :file:`mytable.ibd` and :file:`mytable.exp` ( or :file:`mytable.cfg` if importing to |MySQL| 5.6) files to database's home, and import its tablespace: ::
4659
47 OTHERSERVER|mysql> ALTER TABLE mydatabase.mytable IMPORT TABLESPACE;60 OTHERSERVER|mysql> ALTER TABLE mydatabase.mytable IMPORT TABLESPACE;
4861
4962
=== modified file 'doc/source/percona-theme/layout.html'
--- doc/source/percona-theme/layout.html 2013-08-30 08:52:03 +0000
+++ doc/source/percona-theme/layout.html 2013-11-14 12:32:00 +0000
@@ -349,7 +349,7 @@
349 _gaq.push(['b._trackPageview']);349 _gaq.push(['b._trackPageview']);
350 (function() {350 (function() {
351 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;351 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
352 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google- analytics.com/ga.js';352 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
353 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);353 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
354 })();354 })();
355</script>355</script>
356356
=== renamed file 'doc/source/xtrabackup_bin/exporting_importing_tables.rst' => 'doc/source/xtrabackup_bin/restoring_individual_tables.rst'
--- doc/source/xtrabackup_bin/exporting_importing_tables.rst 2013-05-06 13:52:03 +0000
+++ doc/source/xtrabackup_bin/restoring_individual_tables.rst 2013-11-14 12:32:00 +0000
@@ -1,10 +1,10 @@
1.. _export_import_tables:1.. _export_import_tables:
22
3================================3=============================
4 Exporting and Importing Tables4 Restoring Individual Tables
5================================5=============================
66
7In |InnoDB| versions prior to 5.6, it is not possible to copy tables between servers by copying the files, even with :term:`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 :term:`innodb_file_per_table` to be used on both servers, and requires :term:`innodb_expand_import` to be enabled on the destination server. It only works on individual :term:`.ibd` files, and cannot export a table that is not contained in its own :term:`.ibd` file.7In server versions prior to 5.6, it is not possible to copy tables between servers by copying the files, even with :term:`innodb_file_per_table`. However, with |Percona XtraBackup|, 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 only works on individual :term:`.ibd` files, and cannot export a table that is not contained in its own :term:`.ibd` file.
88
9Let's see how to export and import the following table: ::9Let's see how to export and import the following table: ::
1010
@@ -12,6 +12,10 @@
12 a int(11) DEFAULT NULL12 a int(11) DEFAULT NULL
13 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;13 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
1414
15.. note::
16
17 If you're running |Percona Server| version older than 5.5.10-20.1, variable `innodb_expand_import <http://www.percona.com/doc/percona-server/5.5/management/innodb_expand_import.html#innodb_expand_import>`_ should be used instead of `innodb_import_table_from_xtrabackup <http://www.percona.com/doc/percona-server/5.5/management/innodb_expand_import.html#innodb_import_table_from_xtrabackup>`_.
18
15Exporting the Table19Exporting the Table
16===================20===================
1721
@@ -35,12 +39,12 @@
3539
36.. note:: 40.. note::
3741
38 |MySQL| uses ``.cfg`` file which contains |InnoDB| dictionary dump in special format. This format is different from the ``.exp`` one which is used in |XtraDB| for the same purpose.42 |MySQL| uses ``.cfg`` file which contains |InnoDB| dictionary dump in special format. This format is different from the ``.exp`` one which is used in |XtraDB| for the same purpose. Strictly speaking, a ``.cfg`` file is not required to import a tablespace to |MySQL| 5.6 or |Percona Server| 5.6. A tablespace will be imported successfully even if it is from another server, but |InnoDB| will do schema validation if the corresponding ``.cfg`` file is present in the same directory.
3943
40Importing the Table44Importing the Table
41===================45===================
4246
43On the destination server running |Percona Server| with |XtraDB| and :term:`innodb_expand_import` option enabled, or |MySQL| 5.6, create a table with the same structure, and then perform the following steps:47On the destination server running |Percona Server| with |XtraDB| and `innodb_import_table_from_xtrabackup <http://www.percona.com/doc/percona-server/5.5/management/innodb_expand_import.html#innodb_import_table_from_xtrabackup>`_ option enabled, or |MySQL| 5.6, create a table with the same structure, and then perform the following steps:
4448
45* Execute ``ALTER TABLE test.export_test DISCARD TABLESPACE;``49* Execute ``ALTER TABLE test.export_test DISCARD TABLESPACE;``
46 50
4751
=== modified file 'doc/source/xtrabackup_bin/xbk_option_reference.rst'
--- doc/source/xtrabackup_bin/xbk_option_reference.rst 2013-04-30 07:33:04 +0000
+++ doc/source/xtrabackup_bin/xbk_option_reference.rst 2013-11-14 12:32:00 +0000
@@ -47,7 +47,7 @@
4747
48.. option:: --export48.. option:: --export
4949
50 Create files necessary for exporting tables. See :doc:`Exporting and Importing Tables <exporting_importing_tables>`.50 Create files necessary for exporting tables. See :doc:`Restoring Individual Tables <restoring_individual_tables>`.
5151
52.. option:: --extra-lsndir=name 52.. option:: --extra-lsndir=name
5353
5454
=== modified file 'doc/source/xtrabackup_bin/xtrabackup_binary.rst'
--- doc/source/xtrabackup_bin/xtrabackup_binary.rst 2013-04-29 09:29:00 +0000
+++ doc/source/xtrabackup_bin/xtrabackup_binary.rst 2013-11-14 12:32:00 +0000
@@ -44,7 +44,7 @@
44 scripting_backups_xbk44 scripting_backups_xbk
45 analyzing_table_statistics45 analyzing_table_statistics
46 working_with_binary_logs46 working_with_binary_logs
47 exporting_importing_tables47 restoring_individual_tables
48 lru_dump48 lru_dump
49 49
50.. performance_tunning_innobackupex50.. performance_tunning_innobackupex

Subscribers

People subscribed via source and target branches