Merge lp:~igor-tverdovskiy/percona-xtrabackup/move-back_opt into lp:percona-xtrabackup/2.0
- move-back_opt
- Merge into 2.0
Status: | Rejected | ||||
---|---|---|---|---|---|
Rejected by: | Alexey Kopytov | ||||
Proposed branch: | lp:~igor-tverdovskiy/percona-xtrabackup/move-back_opt | ||||
Merge into: | lp:percona-xtrabackup/2.0 | ||||
Diff against target: |
246 lines (+92/-13) (has conflicts) 2 files modified
innobackupex (+59/-13) test/t/bug803636.sh (+33/-0) Text conflict in innobackupex |
||||
To merge this branch: | bzr merge lp:~igor-tverdovskiy/percona-xtrabackup/move-back_opt | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexey Kopytov (community) | Needs Resubmitting | ||
Laurynas Biveinis (community) | Needs Fixing | ||
Stewart Smith (community) | Needs Fixing | ||
Review via email: mp+93711@code.launchpad.net |
Commit message
Description of the change
move-back opt was added. It does the same as copy-back, but moves files. - useful if not much of free disk space is available.
Vojtech Kurka (vojtech-kurka) wrote : | # |
Please how is the status of this patch? When recovering a compressed backup of 1TB of data, it's not acceptable to wait for copying the data, it can take hours - moving is the only option.
Thank you, Vojtech
Stewart Smith (stewart) wrote : | # |
> Please how is the status of this patch? When recovering a compressed backup of
> 1TB of data, it's not acceptable to wait for copying the data, it can take
> hours - moving is the only option.
> Thank you, Vojtech
If you're able to supply a test case, we can merge it a lot quicker.
- 394. By Igor Tverdovskiy
-
changes applied to the latest innobackupex, test case added
- 395. By Igor Tverdovskiy
-
test case added
Igor Tverdovskiy (igor-tverdovskiy) wrote : | # |
Hi All,
> > Please how is the status of this patch? When recovering a compressed backup
> of
> > 1TB of data, it's not acceptable to wait for copying the data, it can take
> > hours - moving is the only option.
> > Thank you, Vojtech
>
> If you're able to supply a test case, we can merge it a lot quicker.
Test case has been added (bug803636.sh)
All cases are passed or skipped:
> sudo ./run.sh -d /usr
2012-08-29 16:56:50: run.sh: Stopping server with id=1...
2012-08-29 16:56:51: run.sh: Server with id=1 has been stopped
Running against MySQL 5.1.52-log (InnoDB )
Using 'xtrabackup_51' as xtrabackup binary
=======
t/bug1002688.sh [passed]
t/bug1022562.sh [passed]
t/bug1028949.sh [skipped] Requires InnoDB plugin or XtraDB
t/bug483827.sh [passed]
t/bug489290.sh [passed]
t/bug514068.sh [passed]
t/bug606981.sh [passed]
t/bug722638.sh [passed]
t/bug723097.sh [passed]
t/bug723318.sh [passed]
t/bug729843.sh [passed]
t/bug733651.sh [passed]
t/bug759225.sh [skipped] Requires XtraDB
t/bug759701.sh [passed]
t/bug766033.sh [passed]
t/bug766607.sh [passed]
t/bug803636.sh [passed]
t/bug810269.sh [skipped] Requires InnoDB plugin or XtraDB
t/bug817132.sh [skipped] Requires xtradb51
t/bug884737.sh [passed]
t/bug891496.sh [passed]
t/bug932623.sh [passed]
t/bug972169.sh [passed]
t/bug976945.sh [skipped] Requires XtraDB
t/bug977101.sh [passed]
t/bug977652.sh [skipped] Requires qpress to be installed
t/bug983685.sh [passed]
t/bug983695.sh [skipped] Requires qpress to be installed
t/bug983720_galerainfo.sh [skipped] Requires WSREP enabled
t/bug983720_lrudump.sh [skipped] Requires XtraDB
t/bug989397.sh [passed]
t/bug996493.sh [passed]
t/bug999750.sh [skipped] Requires InnoDB plugin or XtraDB
t/ib_binlog_info.sh [passed]
t/ib_csm_csv.sh [passed]
t/ib_empty_dir.sh [passed]
t/ib_incremental.sh [passed]
t/ib_lru_
t/ib_lru_
t/ib_lru_
t/ib_rsync.sh [passed]
t/ib_slave_info.sh [passed]
t/ib_specialchar.sh [passed]
t/ib_stream_
Igor Tverdovskiy (igor-tverdovskiy) wrote : | # |
PS: I have committed the latest innobackupex file with my changes.
Laurynas Biveinis (laurynas-biveinis) wrote : | # |
Unfortunately there are merge conflicts against the current 2.0 trunk, see the diff below.
Igor Tverdovskiy (igor-tverdovskiy) wrote : | # |
> Unfortunately there are merge conflicts against the current 2.0 trunk, see the
> diff below.
Okay, I'm going to add modifications to innobackupex from lp:percona-xtrabackup/2.0 branch. I'll be back soon.
- 396. By Igor Tverdovskiy
-
option added to 2.0 trunk
Igor Tverdovskiy (igor-tverdovskiy) wrote : | # |
done please check
Alexey Kopytov (akopytov) wrote : | # |
There's still one conflict in the pod section of innobackupex:
176 -innobackupex --copy-back [--defaults-
177 +<<<<<<< TREE
178 +innobackupex --copy-back [--defaults-
179 +=======
180 +innobackupex --copy-back [--defaults-
181 + --move-back [--defaults-
182 +>>>>>>> MERGE-SOURCE
I would create a separate line in the help text, rather than add --move-back to the existing one describing the --copy-back synopsis, i.e.:
innobackupex --copy-back [--defaults-
innobackupex --move-back [--defaults-
- 397. By Igor Tverdovskiy
-
move-back hepl text has been separated
Igor Tverdovskiy (igor-tverdovskiy) wrote : | # |
committed please check
Laurynas Biveinis (laurynas-biveinis) wrote : | # |
> committed please check
There are still merge conflicts shown in the diff: around lines 58 and 176.
Igor Tverdovskiy (igor-tverdovskiy) wrote : | # |
> > committed please check
>
> There are still merge conflicts shown in the diff: around lines 58 and 176.
Hi,
I have looked through, however do not see any conflicts there.. Just a single new line of code was added in both cases.
Alexey Kopytov (akopytov) wrote : | # |
Igor,
You can find the remaining conflicts if you look for "<<<" in the Preview Diff. But don't worry, I'll fix it myself in a separate MP along with some minor edits to the patch. Closing this MP.
Igor Tverdovskiy (igor-tverdovskiy) wrote : | # |
I saw these conflicts <<<, however I do not understand what is wrong there... One line was replaced by two lines of code...
Laurynas Biveinis (laurynas-biveinis) wrote : | # |
Probably the reason for all these conflicts is that the submitted branch has been branched off XtraBackup trunk a long time ago, so it is very likely they have diverged.
Igor Tverdovskiy (igor-tverdovskiy) wrote : | # |
It has been branched on 2nd of September from lp:percona-xtrabackup/2.0 branch. Is this branch wrong? I should have used another one?
thanks
Laurynas Biveinis (laurynas-biveinis) wrote : | # |
It does not seem to be branched off lp:percona-xtrabackup/2.0: the last parent branch commit on your branch is rev 392, dated in February. lp:percona-xtrabackup/2.0 currently is at rev 464, made on August 22.
Igor Tverdovskiy (igor-tverdovskiy) wrote : | # |
Well my branch is pretty old because I have added this option in February, however on 2nd September I downloaded innobackupex from 2.0 branch, added my code, replaced old innobackupex in my branch with new one and committed changes.
Laurynas Biveinis (laurynas-biveinis) wrote : | # |
I see, that probably confused bzr into thinking that there are conflicts. One of the correct procedures would be to branch freshly from recent 2.0 and make your changes - this might come handy in the future, as Alexey said he will take care of this MP.
Thanks for working on this.
Igor Tverdovskiy (igor-tverdovskiy) wrote : | # |
ok, thanks for clarification
Laurynas Biveinis (laurynas-biveinis) wrote : | # |
Unmerged revisions
- 397. By Igor Tverdovskiy
-
move-back hepl text has been separated
- 396. By Igor Tverdovskiy
-
option added to 2.0 trunk
- 395. By Igor Tverdovskiy
-
test case added
- 394. By Igor Tverdovskiy
-
changes applied to the latest innobackupex, test case added
- 393. By Igor Tverdovskiy
-
added new option --move-back, just the same as --copy-back, but moves files instead.
Preview Diff
1 | === modified file 'innobackupex' | |||
2 | --- innobackupex 2012-08-02 12:38:15 +0000 | |||
3 | +++ innobackupex 2012-09-02 15:43:18 +0000 | |||
4 | @@ -72,6 +72,7 @@ | |||
5 | 72 | my $option_apply_log = ''; | 72 | my $option_apply_log = ''; |
6 | 73 | my $option_redo_only = ''; | 73 | my $option_redo_only = ''; |
7 | 74 | my $option_copy_back = ''; | 74 | my $option_copy_back = ''; |
8 | 75 | my $option_move_back = ''; | ||
9 | 75 | my $option_include = ''; | 76 | my $option_include = ''; |
10 | 76 | my $option_databases = ''; | 77 | my $option_databases = ''; |
11 | 77 | my $option_tables_file = ''; | 78 | my $option_tables_file = ''; |
12 | @@ -217,6 +218,8 @@ | |||
13 | 217 | my $dst_name; | 218 | my $dst_name; |
14 | 218 | my $win = ($^O eq 'MSWin32' ? 1 : 0); | 219 | my $win = ($^O eq 'MSWin32' ? 1 : 0); |
15 | 219 | my $CP_CMD = ($win eq 1 ? "copy /Y" : "cp -p"); | 220 | my $CP_CMD = ($win eq 1 ? "copy /Y" : "cp -p"); |
16 | 221 | my $MV_CMD = ($win eq 1 ? "move /Y" : "mv -f"); | ||
17 | 222 | my $MV_CP_CMD = ''; | ||
18 | 220 | my $xtrabackup_binary_file = 'xtrabackup_binary'; | 223 | my $xtrabackup_binary_file = 'xtrabackup_binary'; |
19 | 221 | my $xtrabackup_pid_file = 'xtrabackup_pid'; | 224 | my $xtrabackup_pid_file = 'xtrabackup_pid'; |
20 | 222 | my %rsync_files_hash; | 225 | my %rsync_files_hash; |
21 | @@ -237,7 +240,7 @@ | |||
22 | 237 | print_version(); | 240 | print_version(); |
23 | 238 | 241 | ||
24 | 239 | # initialize global variables and perform some checks | 242 | # initialize global variables and perform some checks |
26 | 240 | if ($option_copy_back) { | 243 | if ($option_copy_back || $option_move_back) { |
27 | 241 | $option_ibbackup_binary = 'xtrabackup' if ($option_ibbackup_binary eq 'autodetect'); | 244 | $option_ibbackup_binary = 'xtrabackup' if ($option_ibbackup_binary eq 'autodetect'); |
28 | 242 | } elsif ($option_apply_log) { | 245 | } elsif ($option_apply_log) { |
29 | 243 | # Read XtraBackup version from backup dir | 246 | # Read XtraBackup version from backup dir |
30 | @@ -280,6 +283,9 @@ | |||
31 | 280 | if ($option_copy_back) { | 283 | if ($option_copy_back) { |
32 | 281 | # copy files from backup directory back to their original locations | 284 | # copy files from backup directory back to their original locations |
33 | 282 | copy_back(); | 285 | copy_back(); |
34 | 286 | } elsif ($option_move_back) { | ||
35 | 287 | # move files from backup directory back to their original locations | ||
36 | 288 | move_back(); | ||
37 | 283 | } elsif ($option_apply_log) { | 289 | } elsif ($option_apply_log) { |
38 | 284 | # expand data files in backup directory by applying log files to them | 290 | # expand data files in backup directory by applying log files to them |
39 | 285 | apply_log(); | 291 | apply_log(); |
40 | @@ -627,11 +633,25 @@ | |||
41 | 627 | } | 633 | } |
42 | 628 | 634 | ||
43 | 629 | # | 635 | # |
44 | 636 | # move_back subroutine uses copy_back subroutine to move data and index files | ||
45 | 637 | # from backup directory back to their original locations. | ||
46 | 638 | # | ||
47 | 639 | sub move_back { | ||
48 | 640 | my $move = 'yes'; | ||
49 | 641 | copy_back($move); | ||
50 | 642 | } | ||
51 | 643 | |||
52 | 644 | # | ||
53 | 630 | # copy_back subroutine copies data and index files from backup directory | 645 | # copy_back subroutine copies data and index files from backup directory |
54 | 631 | # back to their original locations. | 646 | # back to their original locations. |
55 | 632 | # | 647 | # |
56 | 633 | sub copy_back { | 648 | sub copy_back { |
58 | 634 | my $orig_datadir = get_option(\%config, $option_defaults_group, 'datadir'); | 649 | <<<<<<< TREE |
59 | 650 | my $orig_datadir = get_option(\%config, $option_defaults_group, 'datadir'); | ||
60 | 651 | ======= | ||
61 | 652 | my($move) = @_; | ||
62 | 653 | my $orig_datadir = get_option(\%config, $option_defaults_group, 'datadir'); | ||
63 | 654 | >>>>>>> MERGE-SOURCE | ||
64 | 635 | my $orig_ibdata_dir = | 655 | my $orig_ibdata_dir = |
65 | 636 | get_option(\%config, $option_defaults_group, 'innodb_data_home_dir'); | 656 | get_option(\%config, $option_defaults_group, 'innodb_data_home_dir'); |
66 | 637 | my $orig_innodb_data_file_path = | 657 | my $orig_innodb_data_file_path = |
67 | @@ -647,6 +667,14 @@ | |||
68 | 647 | my $compressed_data_file = '.*\.ibz$'; | 667 | my $compressed_data_file = '.*\.ibz$'; |
69 | 648 | my $file; | 668 | my $file; |
70 | 649 | my $backup_innodb_data_file_path; | 669 | my $backup_innodb_data_file_path; |
71 | 670 | |||
72 | 671 | # check whether files should be copied or moved to dest directory | ||
73 | 672 | if ($move eq 'yes') { | ||
74 | 673 | $MV_CP_CMD = $MV_CMD; | ||
75 | 674 | } else { | ||
76 | 675 | $MV_CP_CMD = $CP_CMD; | ||
77 | 676 | } | ||
78 | 677 | |||
79 | 650 | # check that original data directories exist and they are empty | 678 | # check that original data directories exist and they are empty |
80 | 651 | if_directory_exists_and_empty($orig_datadir, "Original data"); | 679 | if_directory_exists_and_empty($orig_datadir, "Original data"); |
81 | 652 | if_directory_exists_and_empty($orig_ibdata_dir, "Original InnoDB data"); | 680 | if_directory_exists_and_empty($orig_ibdata_dir, "Original InnoDB data"); |
82 | @@ -678,7 +706,8 @@ | |||
83 | 678 | Die "Backup data file '$backup_dir/$filename' does not exist, but " | 706 | Die "Backup data file '$backup_dir/$filename' does not exist, but " |
84 | 679 | . "its compressed copy '${path}.ibz' exists. Check " | 707 | . "its compressed copy '${path}.ibz' exists. Check " |
85 | 680 | . "that you have run '$innobackup_script --apply-log --uncompress " | 708 | . "that you have run '$innobackup_script --apply-log --uncompress " |
87 | 681 | . "...' before attempting '$innobackup_script --copy-back ...' !"; | 709 | . "...' before attempting '$innobackup_script --copy-back ...' " |
88 | 710 | . "...' or '$innobackup_script --move-back ...' !"; | ||
89 | 682 | } else { | 711 | } else { |
90 | 683 | Die "Backup data file '$backup_dir/$filename' does not exist."; | 712 | Die "Backup data file '$backup_dir/$filename' does not exist."; |
91 | 684 | } | 713 | } |
92 | @@ -706,8 +735,8 @@ | |||
93 | 706 | print STDERR "$prefix Copying file '$backup_dir/$filename'\n"; | 735 | print STDERR "$prefix Copying file '$backup_dir/$filename'\n"; |
94 | 707 | $src_name = escape_path("$backup_dir/$filename"); | 736 | $src_name = escape_path("$backup_dir/$filename"); |
95 | 708 | $dst_name = escape_path("$orig_ibdata_dir/$path"); | 737 | $dst_name = escape_path("$orig_ibdata_dir/$path"); |
98 | 709 | system("$CP_CMD \"$src_name\" \"$dst_name\"") | 738 | system("$MV_CP_CMD \"$src_name\" \"$dst_name\"") |
99 | 710 | and Die "Failed to copy file '$filename': $!"; | 739 | and Die "Failed to copy/move file '$filename': $!"; |
100 | 711 | } | 740 | } |
101 | 712 | 741 | ||
102 | 713 | # copy InnoDB log files to original InnoDB log directory | 742 | # copy InnoDB log files to original InnoDB log directory |
103 | @@ -721,8 +750,8 @@ | |||
104 | 721 | print STDERR "$prefix Copying file '$backup_dir/$file'\n"; | 750 | print STDERR "$prefix Copying file '$backup_dir/$file'\n"; |
105 | 722 | $src_name = escape_path("$backup_dir/$file"); | 751 | $src_name = escape_path("$backup_dir/$file"); |
106 | 723 | $dst_name = escape_path("$orig_iblog_dir"); | 752 | $dst_name = escape_path("$orig_iblog_dir"); |
109 | 724 | system("$CP_CMD \"$src_name\" \"$dst_name\"") | 753 | system("$MV_CP_CMD \"$src_name\" \"$dst_name\"") |
110 | 725 | and Die "Failed to copy file '$file': $!"; | 754 | and Die "Failed to copy/move file '$file': $!"; |
111 | 726 | } | 755 | } |
112 | 727 | } | 756 | } |
113 | 728 | closedir(DIR); | 757 | closedir(DIR); |
114 | @@ -1528,10 +1557,12 @@ | |||
115 | 1528 | my $run = ''; | 1557 | my $run = ''; |
116 | 1529 | 1558 | ||
117 | 1530 | # print some instructions to the user | 1559 | # print some instructions to the user |
119 | 1531 | if (!$option_apply_log && !$option_copy_back) { | 1560 | if (!$option_apply_log && !$option_copy_back && !$option_move_back) { |
120 | 1532 | $run = 'backup'; | 1561 | $run = 'backup'; |
121 | 1533 | } elsif ($option_copy_back) { | 1562 | } elsif ($option_copy_back) { |
122 | 1534 | $run = 'copy-back'; | 1563 | $run = 'copy-back'; |
123 | 1564 | } elsif ($option_move_back) { | ||
124 | 1565 | $run = 'move-back'; | ||
125 | 1535 | } else { | 1566 | } else { |
126 | 1536 | $run = 'apply-log'; | 1567 | $run = 'apply-log'; |
127 | 1537 | } | 1568 | } |
128 | @@ -1541,7 +1572,7 @@ | |||
129 | 1541 | 1572 | ||
130 | 1542 | # check that MySQL client program and InnoDB Hot Backup program | 1573 | # check that MySQL client program and InnoDB Hot Backup program |
131 | 1543 | # are runnable via shell | 1574 | # are runnable via shell |
133 | 1544 | if (!$option_copy_back) { | 1575 | if (!$option_copy_back && !$option_move_back) { |
134 | 1545 | # we are making a backup or applying log to backup | 1576 | # we are making a backup or applying log to backup |
135 | 1546 | if (!$option_apply_log) { | 1577 | if (!$option_apply_log) { |
136 | 1547 | # we are making a backup, we need mysql server | 1578 | # we are making a backup, we need mysql server |
137 | @@ -1589,7 +1620,7 @@ | |||
138 | 1589 | #$innodb_log_group_home_dir = | 1620 | #$innodb_log_group_home_dir = |
139 | 1590 | # get_option(\%config, 'mysqld', 'innodb_log_group_home_dir'); | 1621 | # get_option(\%config, 'mysqld', 'innodb_log_group_home_dir'); |
140 | 1591 | 1622 | ||
142 | 1592 | if (!$option_apply_log && !$option_copy_back) { | 1623 | if (!$option_apply_log && !$option_copy_back && !$option_move_back) { |
143 | 1593 | # we are making a backup, create a new backup directory | 1624 | # we are making a backup, create a new backup directory |
144 | 1594 | if (!$option_remote_host) { | 1625 | if (!$option_remote_host) { |
145 | 1595 | $backup_dir = File::Spec->rel2abs(make_backup_dir()); | 1626 | $backup_dir = File::Spec->rel2abs(make_backup_dir()); |
146 | @@ -1619,7 +1650,7 @@ | |||
147 | 1619 | } | 1650 | } |
148 | 1620 | } | 1651 | } |
149 | 1621 | write_backup_config_file($backup_config_file); | 1652 | write_backup_config_file($backup_config_file); |
151 | 1622 | } elsif ($option_copy_back) { | 1653 | } elsif ($option_copy_back || $option_move_back) { |
152 | 1623 | #$backup_config_file = $backup_dir . '/backup-my.cnf'; | 1654 | #$backup_config_file = $backup_dir . '/backup-my.cnf'; |
153 | 1624 | #read_config_file($backup_config_file, \%backup_config); | 1655 | #read_config_file($backup_config_file, \%backup_config); |
154 | 1625 | } | 1656 | } |
155 | @@ -1715,6 +1746,7 @@ | |||
156 | 1715 | 'apply-log' => \$option_apply_log, | 1746 | 'apply-log' => \$option_apply_log, |
157 | 1716 | 'redo-only' => \$option_redo_only, | 1747 | 'redo-only' => \$option_redo_only, |
158 | 1717 | 'copy-back' => \$option_copy_back, | 1748 | 'copy-back' => \$option_copy_back, |
159 | 1749 | 'move-back' => \$option_move_back, | ||
160 | 1718 | 'include=s' => \$option_include, | 1750 | 'include=s' => \$option_include, |
161 | 1719 | 'databases=s' => \$option_databases, | 1751 | 'databases=s' => \$option_databases, |
162 | 1720 | 'tables-file=s', => \$option_tables_file, | 1752 | 'tables-file=s', => \$option_tables_file, |
163 | @@ -1792,7 +1824,7 @@ | |||
164 | 1792 | # get options file name | 1824 | # get options file name |
165 | 1793 | #$config_file = $ARGV[0]; | 1825 | #$config_file = $ARGV[0]; |
166 | 1794 | 1826 | ||
168 | 1795 | if (!$option_apply_log && !$option_copy_back) { | 1827 | if (!$option_apply_log && !$option_copy_back && !$option_move_back) { |
169 | 1796 | # we are making a backup, get backup root directory | 1828 | # we are making a backup, get backup root directory |
170 | 1797 | $backup_root = $ARGV[0]; | 1829 | $backup_root = $ARGV[0]; |
171 | 1798 | if ($option_incremental && !$option_incremental_lsn) { | 1830 | if ($option_incremental && !$option_incremental_lsn) { |
172 | @@ -2633,7 +2665,13 @@ | |||
173 | 2633 | [--export] [--redo-only] [--ibbackup=IBBACKUP-BINARY] | 2665 | [--export] [--redo-only] [--ibbackup=IBBACKUP-BINARY] |
174 | 2634 | BACKUP-DIR | 2666 | BACKUP-DIR |
175 | 2635 | 2667 | ||
177 | 2636 | innobackupex --copy-back [--defaults-file=MY.CNF] [--defaults-group=GROUP-NAME] BACKUP-DIR | 2668 | <<<<<<< TREE |
178 | 2669 | innobackupex --copy-back [--defaults-file=MY.CNF] [--defaults-group=GROUP-NAME] BACKUP-DIR | ||
179 | 2670 | ======= | ||
180 | 2671 | innobackupex --copy-back [--defaults-file=MY.CNF] [--defaults-group=GROUP-NAME] BACKUP-DIR | ||
181 | 2672 | |||
182 | 2673 | innobackupex --move-back [--defaults-file=MY.CNF] [--defaults-group=GROUP-NAME] BACKUP-DIR | ||
183 | 2674 | >>>>>>> MERGE-SOURCE | ||
184 | 2637 | 2675 | ||
185 | 2638 | =head1 DESCRIPTION | 2676 | =head1 DESCRIPTION |
186 | 2639 | 2677 | ||
187 | @@ -2663,6 +2701,10 @@ | |||
188 | 2663 | The MY.CNF options file defines the original location of the database. | 2701 | The MY.CNF options file defines the original location of the database. |
189 | 2664 | The BACKUP-DIR is the path to a backup directory created by xtrabackup. | 2702 | The BACKUP-DIR is the path to a backup directory created by xtrabackup. |
190 | 2665 | 2703 | ||
191 | 2704 | The --move-back command does just the same as --copy-back. The only difference is | ||
192 | 2705 | that files are moved to data directory instead of be copied. Useful in case you | ||
193 | 2706 | have not much free space at your destination server. | ||
194 | 2707 | |||
195 | 2666 | On success the exit code innobackupex is 0. A non-zero exit code | 2708 | On success the exit code innobackupex is 0. A non-zero exit code |
196 | 2667 | indicates an error. | 2709 | indicates an error. |
197 | 2668 | 2710 | ||
198 | @@ -2691,6 +2733,10 @@ | |||
199 | 2691 | 2733 | ||
200 | 2692 | Copy all the files in a previously made backup from the backup directory to their original locations. | 2734 | Copy all the files in a previously made backup from the backup directory to their original locations. |
201 | 2693 | 2735 | ||
202 | 2736 | =item --move-back | ||
203 | 2737 | |||
204 | 2738 | Move all the files in a previously made backup from the backup directory to the actual datadir location. | ||
205 | 2739 | |||
206 | 2694 | =item --databases=LIST | 2740 | =item --databases=LIST |
207 | 2695 | 2741 | ||
208 | 2696 | This option specifies the list of databases that innobackupex should back up. The option accepts a string argument. The list is of the form "databasename1[.table_name1] databasename2[.table_name2] . . .". If this option is not specified, all databases containing MyISAM and InnoDB tables will be backed up. Please make sure that --databases contains all of the InnoDB databases and tables, so that all of the innodb.frm files are also backed up. In case the list is very long, this can be specified in a file, and the full path of the file can be specified instead of the list. (See option --tables-file.) | 2742 | This option specifies the list of databases that innobackupex should back up. The option accepts a string argument. The list is of the form "databasename1[.table_name1] databasename2[.table_name2] . . .". If this option is not specified, all databases containing MyISAM and InnoDB tables will be backed up. Please make sure that --databases contains all of the InnoDB databases and tables, so that all of the innodb.frm files are also backed up. In case the list is very long, this can be specified in a file, and the full path of the file can be specified instead of the list. (See option --tables-file.) |
209 | 2697 | 2743 | ||
210 | === added file 'test/t/bug803636.sh' | |||
211 | --- test/t/bug803636.sh 1970-01-01 00:00:00 +0000 | |||
212 | +++ test/t/bug803636.sh 2012-09-02 15:43:18 +0000 | |||
213 | @@ -0,0 +1,33 @@ | |||
214 | 1 | . inc/common.sh | ||
215 | 2 | |||
216 | 3 | start_server | ||
217 | 4 | |||
218 | 5 | load_dbase_schema sakila | ||
219 | 6 | load_dbase_data sakila | ||
220 | 7 | |||
221 | 8 | mkdir -p $topdir/backup | ||
222 | 9 | innobackupex $topdir/backup | ||
223 | 10 | backup_dir=`grep "innobackupex: Backup created in directory" $OUTFILE | awk -F\' '{ print $2}'` | ||
224 | 11 | vlog "Backup created in directory $backup_dir" | ||
225 | 12 | |||
226 | 13 | stop_server | ||
227 | 14 | # Remove datadir | ||
228 | 15 | rm -r $mysql_datadir | ||
229 | 16 | #init_mysql_dir | ||
230 | 17 | # Restore sakila | ||
231 | 18 | vlog "Applying log" | ||
232 | 19 | vlog "###########" | ||
233 | 20 | vlog "# PREPARE #" | ||
234 | 21 | vlog "###########" | ||
235 | 22 | innobackupex --apply-log $backup_dir | ||
236 | 23 | vlog "Restoring MySQL datadir" | ||
237 | 24 | mkdir -p $mysql_datadir | ||
238 | 25 | vlog "###########" | ||
239 | 26 | vlog "# RESTORE #" | ||
240 | 27 | vlog "###########" | ||
241 | 28 | innobackupex --move-back $backup_dir | ||
242 | 29 | |||
243 | 30 | start_server | ||
244 | 31 | # Check sakila | ||
245 | 32 | echo ${MYSQL} | ||
246 | 33 | run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila |
The only thing missing here is a test case. It will be fairly easy to write one though. Check out some of the ib_ tests in test/t - they're shell scripts that use a bunch of helper functions provided by the test suite.