mysql-zrm-restore man page

mysql-zrm-restore(1) mysql-zrm-restore(1)

NNAAMMEE
mmyyssqqll--zzrrmm--rreessttoorree - Recovery utility for ZRM for MySQL.

SSYYNNOOPPSSIISS
mmyyssqqll--zzrrmm--rreessttoorree
[----bbaacckkuupp--sseett _n_a_m_e]
[----ssoouurrccee--ddiirreeccttoorryy _d_i_r_e_c_t_o_r_y _n_a_m_e]
[----bbiinn--llooggss _"_/_f_u_l_l_p_a_t_h_/_n_a_m_e_1 _/_f_u_l_l_p_a_t_h_/_n_a_m_e_2 _._._._"]
[----mmyyssqqll--sshhuuttddoowwnn | --no-mysql-shutdown]
[----rreettrryy--ccoouunntt _c_o_u_n_t]
[----rreettrryy--ddeellaayy _s_e_c_o_n_d_s]
[----rreepplliiccaattiioonn|--noreplication]
[----aallll--ddaattaabbaasseess]
[----ddaattaabbaasseess _"_n_a_m_e_1 _n_a_m_e_2 _._._._"]
[----ssttaarrtt--ppoossiittiioonn _#]
[----ssttoopp--ppoossiittiioonn _#]
[----ooffffsseett _#]
[----ssttaarrtt--ddaatteettiimmee _n_a_m_e]
[----ssttoopp--ddaatteettiimmee _n_a_m_e]
[----ccooppyy--pplluuggiinn _p_l_u_g_i_n]
[----sssshh--uusseerr _u_s_e_r]
[----sssshh--iiddeennttiittyy--ffiillee _f_i_l_e_n_a_m_e]
[----ssoocckkeett--rreemmoottee--ppoorrtt _p_o_r_t]
[----ppaassssffiillee _f_i_l_e_n_a_m_e]
[----uusseerr _u_s_e_r]
[----ppaasssswwoorrdd _p_a_s_s_w_o_r_d]
[----hhoosstt _h_o_s_t_n_a_m_e]
[----ppoorrtt _p_o_r_t_n_u_m_b_e_r]
[----ssoocckkeett _n_a_m_e]
[----ssssll--ooppttiioonnss _"_M_y_S_Q_L _s_s_l _o_p_t_i_o_n_s_"]
[----ddeevviiccee--ffss--mmaapp _m_a_p_f_i_l_e_n_a_m_e]
[----ddiissmmoouunntt--eexxiissttiinngg]
[----mmyyssqqll--bbiinnppaatthh _l_o_c_a_t_i_o_n _o_f _M_y_S_Q_L _c_o_m_m_a_n_d_s]
[----ccoommpprreessss--ddaattaa--dduurriinngg--ttrraannssppoorrtt]
[----pprree--rreessttoorree--pplluuggiinn _p_l_u_g_i_n]
[----ppoosstt--rreessttoorree--pplluuggiinn _p_l_u_g_i_n]
[----ttmmppddiirr _t_e_m_p___d_i_r_e_c_t_o_r_y]
[----ooppttiioonnss--ffiillee _f_i_l_e_n_a_m_e]
[----rreessttoorree--mmyyllooaaddeerr--ooppttiioonnss _"_-_-_o_v_e_r_w_r_i_t_e_-_t_a_b_l_e_s
_-_-_e_n_a_b_l_e_-_b_i_n_l_o_g _._._._._"]
[----qquuiieett|----nnoo--qquuiieett]
[----vveerrbboossee]
[----hheellpp]

DDEESSCCRRIIPPTTIIOONN
Recovery of various MySQL databases can be done using the
fImysql-zrm-restore utility. Use it to fully/selectively restore the
database on the same system or another system.

Please take a look at ZRM for MySQL documentation (http://mysql-
backup.zmanda.com/) for procedures on how to configure and use ZRM for
MySQL.

When restoring backed up databases, use either ----aallll--ddaattaabbaasseess or
----ddaattaabbaasseess options.

When the backup contains only specific tables from a database, you need
to specify mmyyssqqll--zzrrmm action as restore and the database name to restore
the backed up tables. Tables not included in the backup but present in
the database will be left untouched.

OOPPTTIIOONNSS
----bbaacckkuupp--sseett _n_a_m_e
Specify backup-set for the backup run. This is a Command line
option only and cannot be specified in the configuration file.
The default value is _B_a_c_k_u_p_S_e_t_1. If such a value is already
present, it will be used.

----ssoouurrccee--ddiirreeccttoorryy _d_i_r_e_c_t_o_r_y _n_a_m_e
Choose the directory containing a backup. This option is ignored
when bbaacckkuupp action is specified. For rreessttoorree action, both
ssoouurrccee--ddiirreeccttoorryy and bbiinn--llooggss options should not be specified.
If both are present, the utility will return an error.

----bbiinn--llooggss "_f_u_l_l_p_a_t_h_n_a_m_e_1 ffuullllppaatthhnnaammee22 ......"
List binary log files, along with their full paths to be used
for restore. For restore action, both ssoouurrccee--ddiirreeccttoorryy and
bbiinn--llooggss options should not be specified. The utility will throw
an error if both are specified

----mmyyssqqll--sshhuuttddoowwnn | ----nnoo--mmyyssqqll--sshhuuttddoowwnn
This specifies whether the mysql server should be shutdown dur-
ing the restore. If not specified, then the mysql server is shut
down only if restoring from a full raw backup. If the options
are not specified and the restore only contains logical full
backup data or incremental backup data, the mysql server is not
shut down. When restoring from a full raw backup it is recom-
mended not to use the --no-mysql-shutdown option as it can
result in unexpected problems.

--retry-count _c_o_u_n_t
This specifies the number of times ZRM should try to attempt the
restore of a raw backup in case the specified copy-plugin
returns an error. This retry is specifically to ensure that we
do not fail the full restore in case the shutdown of the mysql
server takes more time than expected. Hence ZRM will only
attempt to retry for the restore of the very first file that is
attempted to be restored. The default value is 2.

----rreettrryy--ddeellaayy _d_e_l_a_y _i_n _s_e_c_o_n_d_s
This specifies the time in seconds between 2 retrys. The default
value is 5 seconds

----aallll--ddaattaabbaasseess
Opt for all databases to be backed up or restored. This is the
default if _d_a_t_a_b_a_s_e or _d_a_t_a_b_a_s_e_s are not specified.

----ddaattaabbaasseess _"_n_a_m_e_1 _n_a_m_e_2 _._._._"
List the databases to backup or restore.

----rreepplliiccaattiioonn | ----nnoorreepplliiccaattiioonn
Choose replication to restore replication files. They will be
restored only if the host is a replication slave. Default option
is ----nnoorreepplliiccaattiioonn.

----ssttaarrtt--ppoossiittiioonn _N
Fix the start position _N for selective restore of all events
after log position NN. Log position can be determined using
ppaarrssee--bbiinnllooggss action.

----ssttoopp--ppoossiittiioonn _N
Stop selective restore of all events before log position _N. Log
positions can be determined using ppaarrssee--bbiinnllooggss action.

----ooffffsseett _N
Skip the first _N entries of the first binary log file in
bbiinn--llooggss parameter.

----ssttaarrtt--ddaatteettiimmee _d_a_t_e_t_i_m_e
Start selective restore from date and time specified in MySQL
DATETIME or TIMESTAMP format(hh:mm:ss). The utility will throw
an error if the parameter is not in the format.

--stop-datetime _d_a_t_e_t_i_m_e
Selective restore till specified date and time specified in
MySQL DATETIME or TIMESTAMP format(hh:mm:ss). The utility will
return an error if the parameter is not in the format.

----ccooppyy--pplluuggiinn _p_l_u_g_i_n
Specify plugin along with full pathname to be used for transfer-
ring backup files to and from a remote MySQL server to the
machine running ZRM for MySQL. Use this option when
1. remote incremental backup is required
2. copying replication related files from a remote machine
3. execute mmyyssqqllhhoottccooppyy (MySQL command) and copy the data
from the remote machine
4. restore data to a remote machine using mmyyssqqllhhoottccooppyy(MySQL
command). This parameter is optional.

----sssshh--uusseerr _u_s_e_r
Specifies the user to be used for SSH. This parameter is only
used by the ssh-copy.pl plugin. The user specified should either
be the user mysqld runs as or root. If not specified the default
value used is mysql. This parameter is optional.

----sssshh--iiddeennttiiffyy--ffiillee _f_i_l_e_n_a_m_e
Selects a file from which the identity (private key) for RSA or
DSA authentication is read. This identity file is used by the
ssh-copy.pl plugin for authentication.

----ssoocckkeett--rreemmoottee--ppoorrtt _p_o_r_t
Port that the socket-plugin.pl should use to connect. This
parameter is only used by the socket-copy.pl plugin. The default
value used is 25300. This parameter is optional

----ppaassssffiillee _f_i_l_e
The file containing the passphrase for encryption. This parame-
ter is used only by the encrypt-plugin.pl. If not specified the
value used is /etc/mysql-zrm/.passphrase. This parameter is
optional.

----uusseerr _u_s_e_r
Specify MySQL backup/restore user

----ppaasssswwoorrdd _p_a_s_s_w_o_r_d
Specify password for the MySQL user

----hhoosstt _h_o_s_t_n_a_m_e
Specify MySQL server host name or IP name.

----ppoorrtt _p_o_r_t_n_u_m_b_e_r
Specify MySQL server port.

----ssoocckkeett _n_a_m_e
Specify socket file to use for communication with MySQL server.

----ssssll--ooppttiioonnss _"_M_y_S_Q_L _s_s_l _o_p_t_i_o_n_s_"
Set any --ssl* options that MySQL supports. Refer to MySQL Docu-
mentation for SSL options details.

----mmyyssqqll--bbiinnppaatthh _m_y_s_q_l___b_i_n_a_r_i_e_s___d_i_r
Set the full path where MySQL binaries are installed. For exam-
ple: //oopptt//llaammpppp//bbiinn

----ccoommpprreessss--ddaattaa--dduurriinngg--ttrraannssppoorrtt
If the value is set to 1, the image being restored is compressed
when it transferred from ZRM server to restore destination.
Setting the value to zero, no compression is performed. No com-
pression is performed by default. Data compression during trans-
fer is independent of the Backup image compression parameter.

----pprree--rreessttoorree--pplluuggiinn _p_l_u_g_i_n

----ppoosstt--rreessttoorree--pplluuggiinn _p_l_u_g_i_n
(Optional) Specify the plugin along with full pathname to be
called before a full or incremental restore is started
(pprree--rreessttoorree--pplluuggiinn) or after a restore is completed
(ppoosstt--rreessttoorree--pplluuggiinn). The plugins is executed on ZRM server.
The plugins are called with following parameters:

----ssoouurrccee--ddiirreeccttoorryy
The directory containing the backup image being restored.

----bbiinn--llooggss
The list of binary logs to be parsed. Either ssoouurrccee--ddiirreecc--
ttoorryy or bbiinn--llooggss is passed as parameter

----bbaacckkuupp--lleevveell
BBaacckkuupp lleevveell:: ffuullll ((00)) oorr iinnccrreemmeennttaall ((11))

----mmyyssqqll--sshhuuttddoowwnn
This parameter is passed if MySQL server was shutdown

----zzrrmm--eerrrroorr _e_r_r_o_r _c_o_d_e
Restoration error. This parameter is passed if there is a
fatal restoration error.

The script should be written to return a non-zero value on
error.

--options-file _f_i_l_e_n_a_m_e
Set the file along with full pathname that contains MySQL com-
mand options.

--restore-myloader-options
Pass the extra parameters during the Restore if backup was done
by mydumper.

----ttmmppddiirr _t_e_m_p___d_i_r_e_c_t_o_r_y
Full path of the directory for storing temporary files and
directories on the backup host. The default is to use the sys-
tem-specified temporary directory on the backup host, e.g /tmp.

----qquuiieett|----nnoo--qquuiieett
Choose qquuiieett to suppress display of log messages on stdout.
Choose nnoo--qquuiieett to display the log messages to standard output
(ssttddoouutt). The default is ----nnoo--qquuiieett.

----vveerrbboossee
Provide more detailed output in the log. Verbose output is
turned off by default.

----hheellpp Displays the help message and exits. This command line only
parameter cannot be specified in the configuration file.

EEXXAAMMPPLLEESS
For restoring backup image dated 18 Aug 2006 (backup image can be
either full or incremental backup):

mmyyssqqll--zzrrmm ----aaccttiioonn rreessttoorree ----ssoouurrccee--ddiirreeccttoorryy //vvaarr//lliibb//mmyyssqqll--zzrrmm//bbaacckk--
uuppsseett11//2200006600881188112211553322

The above command will restore all databases (full or incremental as
the case may be) that were backed up.

mmyyssqqll--zzrrmm ----aaccttiioonn rreessttoorree ----ssoouurrccee--ddiirreeccttoorryy //vvaarr//lliibb//mmyyssqqll--zzrrmm//bbaacckk--
uuppsseett11//2200006600881188112211553322 ----ddaattaabbaasseess ddbb11 ddbb22 ddbb33

The above command does a selective restore of the specified databases.

mmyyssqqll--zzrrmm ----aaccttiioonn rreessttoorree ----bbiinn--llooggss //vvaarr//lliibb//mmyyssqqll--zzrrmm//bbaacckk--
uuppsseett11//2200006600881188112211553322//mmyyssqqll--bbiinn..[[00--99]]** //vvaarr//lliibb//mmyyssqqll--zzrrmm//bbaacckk--
uuppsseett11//2200006600881199112211553322//mmyyssqqll--bbiinn..[[00--99]]**

The above command does a selective restore of all specified binary log
files using a single MySQL server connection.

FFIILLEESS
//vvaarr//lliibb//mmyyssqqll--zzrrmm
Directory under which all backup data is stored.

//eettcc//mmyyssqqll--zzrrmm//_b_a_c_k_u_p _s_e_t _n_a_m_e//mmyyssqqll--zzrrmm..ccoonnff
Configuration file read by mmyyssqqll--zzrrmm utility.

RREETTUURRNN VVAALLUUEESS
On success, zero is returned. On error, non-zero value is returned.

SSEEEE AALLSSOO
mysql-zrm(1), mysql-zrm-backup(1), mysql-zrm-check(1),
mysql-zrm-list(1), mysql-zrm-manage-backup(1), mysql-zrm-getconf(1),
mysql-zrm-setconf(1), mysql-zrm-parse-binlogs(1), mysql-zrm-purge(1),
mysql-zrm-extract-backup(1), mysql-zrm-verify-backup(1),
mysql-zrm-abort-backup(1), mysql-zrm-scheduler(1),
mysql-zrm-reporter(1), mysql-zrm.conf(5), mysqldump(1), mysqlbinlog(1),
mysql(1), lvm(8), Zmanda Recovery Manager for MySQL (http://mysql-
backup.zmanda.com/)

AAUUTTHHOORR
Zmanda Inc. (http://www.zmanda.com)

Zmanda, Inc. ZRM for MySQL mysql-zrm-restore(1)

Referenced By

mysql-zrm(1), mysql-zrm-abort-backup(1), mysql-zrm-backup(1), mysql-zrm-check(1), mysql-zrm.conf(5), mysql-zrm-extract-backup(1), mysql-zrm-list(1), mysql-zrm-parse-binlogs(1), mysql-zrm-purge(1), mysql-zrm-scheduler(1), mysql-zrm-verify-backup(1).