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
1=== modified file 'doc/source/faq.rst'
2--- doc/source/faq.rst 2013-08-30 08:52:03 +0000
3+++ doc/source/faq.rst 2013-11-14 12:32:00 +0000
4@@ -55,3 +55,8 @@
5 ============================================================================================
6
7 In 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.
8+
9+Backup fails with Error 24: 'Too many open files'
10+=================================================
11+
12+This 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).
13
14=== modified file 'doc/source/glossary.rst'
15--- doc/source/glossary.rst 2013-08-30 08:52:03 +0000
16+++ doc/source/glossary.rst 2013-11-14 12:32:00 +0000
17@@ -88,7 +88,7 @@
18 Each |MyISAM| table has ``.MYI`` (MYIndex) file which contains the table's indexes.
19
20 .exp
21- 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.
22+ 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>`"
23
24 .MRG
25 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.
26
27=== modified file 'doc/source/howtos/recipes_ibkx_partition.rst'
28--- doc/source/howtos/recipes_ibkx_partition.rst 2013-08-30 08:52:03 +0000
29+++ doc/source/howtos/recipes_ibkx_partition.rst 2013-11-14 12:32:00 +0000
30@@ -36,7 +36,7 @@
31 Preparing the backup
32 =====================
33
34-For 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::
35+For 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::
36
37 $ innobackupex --apply-log --export /mnt/backup/2012-08-28_10-29-09
38
39@@ -65,10 +65,11 @@
40 Restoring from the backups
41 ==========================
42
43-Restoring should be done by :doc:`importing the tables <../innobackupex/importing_exporting_tables_ibk>` in the partial backup to the server.
44+Restoring should be done by :doc:`importing the tables <../innobackupex/restoring_individual_tables_ibk>` in the partial backup to the server.
45
46 .. note::
47- 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.
48+
49+ 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.
50
51 First step is to create new table in which data will be restored ::
52
53
54=== modified file 'doc/source/index.rst'
55--- doc/source/index.rst 2013-04-29 09:29:00 +0000
56+++ doc/source/index.rst 2013-11-14 12:32:00 +0000
57@@ -7,13 +7,13 @@
58 Percona Xtrabackup - Documentation
59 ====================================
60
61-*Percona* |XtraBackup| is an open-source hot backup utility for |MySQL| - based servers that doesn't lock your database during the backup.
62+|Percona XtraBackup| is an open-source hot backup utility for |MySQL| - based servers that doesn't lock your database during the backup.
63
64 It 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`.
65
66-Whether 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/>`_.
67+Whether 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/>`_.
68
69-*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.
70+|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.
71
72 Introduction
73 ============
74
75=== modified file 'doc/source/innobackupex/innobackupex_script.rst'
76--- doc/source/innobackupex/innobackupex_script.rst 2013-04-29 09:29:00 +0000
77+++ doc/source/innobackupex/innobackupex_script.rst 2013-11-14 12:32:00 +0000
78@@ -47,7 +47,7 @@
79 parallel_copy_ibk
80 throttling_ibk
81 remote_backups_ibk
82- importing_exporting_tables_ibk
83+ restoring_individual_tables_ibk
84 pit_recovery_ibk
85
86
87
88=== modified file 'doc/source/innobackupex/partial_backups_innobackupex.rst'
89--- doc/source/innobackupex/partial_backups_innobackupex.rst 2013-08-30 08:52:03 +0000
90+++ doc/source/innobackupex/partial_backups_innobackupex.rst 2013-11-14 12:32:00 +0000
91@@ -14,7 +14,7 @@
92 Using the :option:`--include` option
93 ------------------------------------
94
95-The regular expression provided to this will be matched against the fully qualified tablename, including the database name, in the form ``databasename.tablename``.
96+The regular expression provided to this will be matched against the fully qualified table name, including the database name, in the form ``databasename.tablename``.
97
98 For example, ::
99
100@@ -57,7 +57,7 @@
101 Preparing Partial Backups
102 =========================
103
104-For preparing partial backups, the procedure is analogous to :doc:`exporting tables <importing_exporting_tables_ibk>` : apply the logs and use the :option:`--export` option::
105+For 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::
106
107 $ innobackupex --apply-log --export /path/to/partial/backup
108
109@@ -84,7 +84,7 @@
110 Restoring Partial Backups
111 =========================
112
113-Restoring should be done by :doc:`importing the tables <importing_exporting_tables_ibk>` in the partial backup to the server.
114+Restoring should be done by :doc:`restoring individual tables <restoring_individual_tables_ibk>` in the partial backup to the server.
115
116 It 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: ::
117
118
119=== renamed file 'doc/source/innobackupex/importing_exporting_tables_ibk.rst' => 'doc/source/innobackupex/restoring_individual_tables_ibk.rst'
120--- doc/source/innobackupex/importing_exporting_tables_ibk.rst 2013-03-19 15:21:27 +0000
121+++ doc/source/innobackupex/restoring_individual_tables_ibk.rst 2013-11-14 12:32:00 +0000
122@@ -1,14 +1,14 @@
123 .. _imp_exp_ibk:
124
125-===========================================
126- Importing and Exporting Individual Tables
127-===========================================
128-
129-In 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|.
130-
131-The 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.
132-
133-The 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.
134+=============================
135+ Restoring Individual Tables
136+=============================
137+
138+In 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.
139+
140+.. note::
141+
142+ 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>`_.
143
144 Exporting tables
145 ================
146@@ -25,7 +25,20 @@
147 `./mydatabase/mytable.exp` (1 indexes)
148 ..
149
150-Each :term:`.exp` file will be used for importing that table.
151+Now you should see a :term:`.exp` file in the target directory: ::
152+
153+ $ find /data/backups/mysql/ -name export_test.*
154+ /data/backups/mysql/test/export_test.exp
155+ /data/backups/mysql/test/export_test.ibd
156+ /data/backups/mysql/test/export_test.cfg
157+
158+These three files are all you need to import the table into a server running |Percona Server| with |XtraDB| or |MySQL| 5.6.
159+
160+.. note::
161+
162+ |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.
163+
164+Each :term:`.exp` (or ``.cfg``) file will be used for importing that table.
165
166 .. note::
167
168@@ -42,7 +55,7 @@
169
170 OTHERSERVER|mysql> ALTER TABLE mydatabase.mytable DISCARD TABLESPACE;
171
172-After this, copy :file:`mytable.ibd` and :file:`mytable.exp` files to database's home, and import its tablespace: ::
173+After 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: ::
174
175 OTHERSERVER|mysql> ALTER TABLE mydatabase.mytable IMPORT TABLESPACE;
176
177
178=== modified file 'doc/source/percona-theme/layout.html'
179--- doc/source/percona-theme/layout.html 2013-08-30 08:52:03 +0000
180+++ doc/source/percona-theme/layout.html 2013-11-14 12:32:00 +0000
181@@ -349,7 +349,7 @@
182 _gaq.push(['b._trackPageview']);
183 (function() {
184 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
185- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google- analytics.com/ga.js';
186+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
187 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
188 })();
189 </script>
190
191=== renamed file 'doc/source/xtrabackup_bin/exporting_importing_tables.rst' => 'doc/source/xtrabackup_bin/restoring_individual_tables.rst'
192--- doc/source/xtrabackup_bin/exporting_importing_tables.rst 2013-05-06 13:52:03 +0000
193+++ doc/source/xtrabackup_bin/restoring_individual_tables.rst 2013-11-14 12:32:00 +0000
194@@ -1,10 +1,10 @@
195 .. _export_import_tables:
196
197-================================
198- Exporting and Importing Tables
199-================================
200+=============================
201+ Restoring Individual Tables
202+=============================
203
204-In |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.
205+In 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.
206
207 Let's see how to export and import the following table: ::
208
209@@ -12,6 +12,10 @@
210 a int(11) DEFAULT NULL
211 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
212
213+.. note::
214+
215+ 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>`_.
216+
217 Exporting the Table
218 ===================
219
220@@ -35,12 +39,12 @@
221
222 .. note::
223
224- |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.
225+ |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.
226
227 Importing the Table
228 ===================
229
230-On 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:
231+On 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:
232
233 * Execute ``ALTER TABLE test.export_test DISCARD TABLESPACE;``
234
235
236=== modified file 'doc/source/xtrabackup_bin/xbk_option_reference.rst'
237--- doc/source/xtrabackup_bin/xbk_option_reference.rst 2013-04-30 07:33:04 +0000
238+++ doc/source/xtrabackup_bin/xbk_option_reference.rst 2013-11-14 12:32:00 +0000
239@@ -47,7 +47,7 @@
240
241 .. option:: --export
242
243- Create files necessary for exporting tables. See :doc:`Exporting and Importing Tables <exporting_importing_tables>`.
244+ Create files necessary for exporting tables. See :doc:`Restoring Individual Tables <restoring_individual_tables>`.
245
246 .. option:: --extra-lsndir=name
247
248
249=== modified file 'doc/source/xtrabackup_bin/xtrabackup_binary.rst'
250--- doc/source/xtrabackup_bin/xtrabackup_binary.rst 2013-04-29 09:29:00 +0000
251+++ doc/source/xtrabackup_bin/xtrabackup_binary.rst 2013-11-14 12:32:00 +0000
252@@ -44,7 +44,7 @@
253 scripting_backups_xbk
254 analyzing_table_statistics
255 working_with_binary_logs
256- exporting_importing_tables
257+ restoring_individual_tables
258 lru_dump
259
260 .. performance_tunning_innobackupex

Subscribers

People subscribed via source and target branches