1mysql‐zrm‐restore(1)                                       mysql‐
2zrm‐restore(1)
3
4
5
6NNAAMMEE
7       mmyyssqqll‐‐zzrrmm‐‐rreessttoorree ‐ Recovery utility for ZRM for MySQL.
8
9SSYYNNOOPPSSIISS
10       mmyyssqqll‐‐zzrrmm‐‐rreessttoorree
11                       [‐‐‐‐bbaacckkuupp‐‐sseett _n_a_m_e]
12                       [‐‐‐‐ssoouurrccee‐‐ddiirreeccttoorryy _d_i_r_e_c_t_o_r_y _n_a_m_e]
13                       [‐‐‐‐bbiinn‐‐llooggss               _"_/_f_u_l_l_p_a_t_h_/_n_a_m_e_1
14_/_f_u_l_l_p_a_t_h_/_n_a_m_e_2 _._._._"]
15                       [‐‐‐‐mmyyssqqll‐‐sshhuuttddoowwnn | ‐‐no‐mysql‐shutdown]
16                       [‐‐‐‐rreettrryy‐‐ccoouunntt _c_o_u_n_t]
17                       [‐‐‐‐rreettrryy‐‐ddeellaayy _s_e_c_o_n_d_s]
18                       [‐‐‐‐rreepplliiccaattiioonn|‐‐noreplication]
19                       [‐‐‐‐aallll‐‐ddaattaabbaasseess]
20                       [‐‐‐‐ddaattaabbaasseess _"_n_a_m_e_1 _n_a_m_e_2 _._._._"]
21                       [‐‐‐‐ssttaarrtt‐‐ppoossiittiioonn _#]
22                       [‐‐‐‐ssttoopp‐‐ppoossiittiioonn _#]
23                       [‐‐‐‐ooffffsseett _#]
24                       [‐‐‐‐ssttaarrtt‐‐ddaatteettiimmee _n_a_m_e]
25                       [‐‐‐‐ssttoopp‐‐ddaatteettiimmee _n_a_m_e]
26                       [‐‐‐‐ccooppyy‐‐pplluuggiinn _p_l_u_g_i_n]
27                       [‐‐‐‐sssshh‐‐uusseerr _u_s_e_r]
28                       [‐‐‐‐sssshh‐‐iiddeennttiittyy‐‐ffiillee _f_i_l_e_n_a_m_e]
29                       [‐‐‐‐ssoocckkeett‐‐rreemmoottee‐‐ppoorrtt _p_o_r_t]
30                       [‐‐‐‐ppaassssffiillee _f_i_l_e_n_a_m_e]
31                       [‐‐‐‐uusseerr _u_s_e_r]
32                       [‐‐‐‐ppaasssswwoorrdd _p_a_s_s_w_o_r_d]
33                       [‐‐‐‐hhoosstt _h_o_s_t_n_a_m_e]
34                       [‐‐‐‐ppoorrtt _p_o_r_t_n_u_m_b_e_r]
35                       [‐‐‐‐ssoocckkeett _n_a_m_e]
36                       [‐‐‐‐ssssll‐‐ooppttiioonnss _"_M_y_S_Q_L _s_s_l _o_p_t_i_o_n_s_"]
37                       [‐‐‐‐ddeevviiccee‐‐ffss‐‐mmaapp _m_a_p_f_i_l_e_n_a_m_e]
38                       [‐‐‐‐ddiissmmoouunntt‐‐eexxiissttiinngg]
39                       [‐‐‐‐mmyyssqqll‐‐bbiinnppaatthh    _l_o_c_a_t_i_o_n    _o_f   _M_y_S_Q_L
40_c_o_m_m_a_n_d_s]
41                       [‐‐‐‐ccoommpprreessss‐‐ddaattaa‐‐dduurriinngg‐‐ttrraannssppoorrtt]
42                       [‐‐‐‐pprree‐‐rreessttoorree‐‐pplluuggiinn _p_l_u_g_i_n]
43                       [‐‐‐‐ppoosstt‐‐rreessttoorree‐‐pplluuggiinn _p_l_u_g_i_n]
44                       [‐‐‐‐ttmmppddiirr _t_e_m_p___d_i_r_e_c_t_o_r_y]
45                       [‐‐‐‐ooppttiioonnss‐‐ffiillee _f_i_l_e_n_a_m_e]
46                       [‐‐‐‐rreessttoorree‐‐mmyyllooaaddeerr‐‐ooppttiioonnss
47_"_‐_‐_o_v_e_r_w_r_i_t_e_‐_t_a_b_l_e_s
48       _‐_‐_e_n_a_b_l_e_‐_b_i_n_l_o_g _._._._._"]
49                       [‐‐‐‐qquuiieett|‐‐‐‐nnoo‐‐qquuiieett]
50                       [‐‐‐‐vveerrbboossee]
51                       [‐‐‐‐hheellpp]
52
53
54
55DDEESSCCRRIIPPTTIIOONN
56       Recovery   of  various  MySQL  databases   can   be   done
57using   the
58       fImysql‐zrm‐restore  utility.  Use  it to fully/selective‐
59ly restore the
60       database on the same system or another system.
61
62       Please  take  a   look  at  ZRM  for  MySQL  documentation
63(http://mysql
64       backup.zmanda.com/)  for procedures on  how  to  configure
65and use ZRM for
66       MySQL.
67
68       When   restoring   backed   up   databases,   use   either
69‐‐‐‐aallll‐‐ddaattaabbaasseess  or
70       ‐‐‐‐ddaattaabbaasseess options.
71
72       When the backup contains only specific tables from a data‐
73base, you need
74       to  specify  mmyyssqqll‐‐zzrrmm  action as restore and the database
75name to restore
76       the backed up tables.  Tables not included in  the  backup
77but present in
78       the database will be left untouched.
79
80
81OOPPTTIIOONNSS
82       ‐‐‐‐bbaacckkuupp‐‐sseett _n_a_m_e
83              Specify  backup‐set  for the backup run. This is  a
84Command  line
85              option  only  and cannot be specified in  the  con‐
86figuration file.
87              The default value is _B_a_c_k_u_p_S_e_t_1. If  such  a  value
88is  already
89              present, it will be used.
90
91       ‐‐‐‐ssoouurrccee‐‐ddiirreeccttoorryy _d_i_r_e_c_t_o_r_y _n_a_m_e
92              Choose the directory containing a backup. This  op‐
93tion is ignored
94              when  bbaacckkuupp   action  is  specified.  For  rreessttoorree
95action,  both
96              ssoouurrccee‐‐ddiirreeccttoorryy  and  bbiinn‐‐llooggss options should  not
97be specified.
98              If both are present, the utility will return an er‐
99ror.
100
101       ‐‐‐‐bbiinn‐‐llooggss "_f_u_l_l_p_a_t_h_n_a_m_e_1 ffuullllppaatthhnnaammee22 ......"
102              List binary log files, along with their full  paths
103to  be  used
104              for    restore.     For    restore   action,   both
105ssoouurrccee‐‐ddiirreeccttoorryy and
106              bbiinn‐‐llooggss options should not be specified. The util‐
107ity will throw
108              an error if both are specified
109
110       ‐‐‐‐mmyyssqqll‐‐sshhuuttddoowwnn | ‐‐‐‐nnoo‐‐mmyyssqqll‐‐sshhuuttddoowwnn
111              This   specifies whether the mysql server should be
112shutdown dur‐
113              ing the restore. If not specified, then  the  mysql
114server is shut
115              down   only   if  restoring from a full raw backup.
116If the options
117              are not specified and the restore   only   contains
118logical  full
119              backup   data or incremental backup data, the mysql
120server is not
121              shut down. When restoring from a  full  raw  backup
122it  is  recom‐
123              mended  not  to  use  the  ‐‐no‐mysql‐shutdown  op‐
124tion as it can
125              result in unexpected problems.
126
127       ‐‐retry‐count _c_o_u_n_t
128              This specifies the number of times ZRM  should  try
129to attempt the
130              restore   of   a  raw  backup  in  case  the speci‐
131fied copy‐plugin
132              returns an error. This retry is specifically to en‐
133sure  that  we
134              do  not  fail the full restore in case the shutdown
135of the mysql
136              server takes more   time   than   expected.   Hence
137ZRM  will  only
138              attempt  to retry for the restore of the very first
139file that is
140              attempted to be restored. The default value is 2.
141
142       ‐‐‐‐rreettrryy‐‐ddeellaayy _d_e_l_a_y _i_n _s_e_c_o_n_d_s
143              This  specifies  the  time  in  seconds  between  2
144retrys. The default
145              value is 5 seconds
146
147       ‐‐‐‐aallll‐‐ddaattaabbaasseess
148              Opt   for   all  databases  to  be backed up or re‐
149stored. This is the
150              default if _d_a_t_a_b_a_s_e or _d_a_t_a_b_a_s_e_s are not specified.
151
152       ‐‐‐‐ddaattaabbaasseess _"_n_a_m_e_1 _n_a_m_e_2 _._._._"
153              List the databases to backup or restore.
154
155       ‐‐‐‐rreepplliiccaattiioonn | ‐‐‐‐nnoorreepplliiccaattiioonn
156              Choose replication to  restore  replication  files.
157They  will  be
158              restored  only  if the host is a replication slave.
159Default option
160              is ‐‐‐‐nnoorreepplliiccaattiioonn.
161
162       ‐‐‐‐ssttaarrtt‐‐ppoossiittiioonn _N
163              Fix the start position _N for selective  restore  of
164all  events
165              after  log  position  NN.  Log  position  can be de‐
166termined using
167              ppaarrssee‐‐bbiinnllooggss action.
168
169       ‐‐‐‐ssttoopp‐‐ppoossiittiioonn _N
170              Stop selective restore of all events before log po‐
171sition _N.  Log
172              positions can be determined using ppaarrssee‐‐bbiinnllooggss ac‐
173tion.
174
175       ‐‐‐‐ooffffsseett _N
176              Skip  the  first  _N  entries  of  the  first  bina‐
177ry log file in
178              bbiinn‐‐llooggss parameter.
179
180       ‐‐‐‐ssttaarrtt‐‐ddaatteettiimmee _d_a_t_e_t_i_m_e
181              Start  selective restore from date and time  speci‐
182fied  in  MySQL
183              DATETIME  or  TIMESTAMP format(hh:mm:ss). The util‐
184ity will throw
185              an error if the parameter is not in the format.
186
187       ‐‐stop‐datetime _d_a_t_e_t_i_m_e
188              Selective  restore  till specified  date  and  time
189specified  in
190              MySQL  DATETIME or TIMESTAMP format(hh:mm:ss).  The
191utility will
192              return an error if the parameter is not in the for‐
193mat.
194
195       ‐‐‐‐ccooppyy‐‐pplluuggiinn _p_l_u_g_i_n
196              Specify plugin along with full pathname to be  used
197for transfer‐
198              ring   backup  files  to  and  from  a remote MySQL
199server to the
200              machine running ZRM for  MySQL.   Use  this  option
201when
202                 1. remote incremental backup is required
203                 2.  copying replication related files from a re‐
204mote machine
205                 3. execute  mmyyssqqllhhoottccooppyy  (MySQL  command)   and
206copy  the  data
207              from the remote machine
208                 4.   restore  data  to  a  remote  machine using
209mmyyssqqllhhoottccooppyy(MySQL
210              command).  This parameter is optional.
211
212       ‐‐‐‐sssshh‐‐uusseerr _u_s_e_r
213              Specifies the user to be used for SSH. This  param‐
214eter  is  only
215              used  by the ssh‐copy.pl plugin. The user specified
216should either
217              be the user mysqld runs as or root. If  not  speci‐
218fied the default
219              value used is mysql. This parameter is optional.
220
221       ‐‐‐‐sssshh‐‐iiddeennttiiffyy‐‐ffiillee _f_i_l_e_n_a_m_e
222              Selects   a  file  from which the identity (private
223key) for RSA or
224              DSA authentication is read. This identity  file  is
225used  by  the
226              ssh‐copy.pl plugin for authentication.
227
228       ‐‐‐‐ssoocckkeett‐‐rreemmoottee‐‐ppoorrtt _p_o_r_t
229              Port   that  the  socket‐plugin.pl  should  use  to
230connect. This
231              parameter is only used by the socket‐copy.pl  plug‐
232in. The default
233              value used is 25300. This parameter is optional
234
235       ‐‐‐‐ppaassssffiillee _f_i_l_e
236              The  file containing the passphrase for encryption.
237This parame‐
238              ter is used only by the encrypt‐plugin.pl.  If  not
239specified  the
240              value   used  is  /etc/mysql‐zrm/.passphrase.  This
241parameter is
242              optional.
243
244       ‐‐‐‐uusseerr _u_s_e_r
245              Specify MySQL backup/restore user
246
247       ‐‐‐‐ppaasssswwoorrdd _p_a_s_s_w_o_r_d
248              Specify password for the MySQL user
249
250       ‐‐‐‐hhoosstt _h_o_s_t_n_a_m_e
251              Specify MySQL server host name or IP name.
252
253       ‐‐‐‐ppoorrtt _p_o_r_t_n_u_m_b_e_r
254              Specify MySQL server port.
255
256       ‐‐‐‐ssoocckkeett _n_a_m_e
257              Specify socket file to use for  communication  with
258MySQL  server.
259
260       ‐‐‐‐ssssll‐‐ooppttiioonnss _"_M_y_S_Q_L _s_s_l _o_p_t_i_o_n_s_"
261              Set  any  ‐‐ssl* options that MySQL supports. Refer
262to MySQL Docu‐
263              mentation for SSL options details.
264
265       ‐‐‐‐mmyyssqqll‐‐bbiinnppaatthh _m_y_s_q_l___b_i_n_a_r_i_e_s___d_i_r
266              Set the full path  where  MySQL  binaries  are  in‐
267stalled. For  exam‐
268              ple: //oopptt//llaammpppp//bbiinn
269
270       ‐‐‐‐ccoommpprreessss‐‐ddaattaa‐‐dduurriinngg‐‐ttrraannssppoorrtt
271              If  the value is set to 1, the image being restored
272is compressed
273              when it transferred from  ZRM  server  to   restore
274destination.
275              Setting  the  value to zero, no compression is per‐
276formed.  No com‐
277              pression is performed by default. Data  compression
278during trans‐
279              fer  is independent of the Backup image compression
280parameter.
281
282       ‐‐‐‐pprree‐‐rreessttoorree‐‐pplluuggiinn _p_l_u_g_i_n
283
284       ‐‐‐‐ppoosstt‐‐rreessttoorree‐‐pplluuggiinn _p_l_u_g_i_n
285              (Optional)  Specify  the  plugin  along  with  full
286pathname to be
287              called   before   a  full  or  incremental  restore
288is   started
289              (pprree‐‐rreessttoorree‐‐pplluuggiinn)    or    after    a    restore
290is   completed
291              (ppoosstt‐‐rreessttoorree‐‐pplluuggiinn).   The plugins is executed on
292ZRM  server.
293              The plugins are called with following parameters:
294
295              ‐‐‐‐ssoouurrccee‐‐ddiirreeccttoorryy
296                  The directory containing the backup image being
297restored.
298
299              ‐‐‐‐bbiinn‐‐llooggss
300                  The   list  of binary logs to be parsed. Either
301ssoouurrccee‐‐ddiirreecc‐‐
302              ttoorryy or bbiinn‐‐llooggss is passed as parameter
303
304              ‐‐‐‐bbaacckkuupp‐‐lleevveell
305                  BBaacckkuupp lleevveell:: ffuullll ((00)) oorr iinnccrreemmeennttaall ((11))
306
307              ‐‐‐‐mmyyssqqll‐‐sshhuuttddoowwnn
308                  This parameter is passed if  MySQL  server  was
309shutdown
310
311              ‐‐‐‐zzrrmm‐‐eerrrroorr _e_r_r_o_r _c_o_d_e
312                  Restoration  error. This parameter is passed if
313there  is  a
314              fatal restoration error.
315
316              The  script  should  be  written  to  return a non‐
317zero value on
318              error.
319
320       ‐‐options‐file _f_i_l_e_n_a_m_e
321              Set the file along with full pathname that contains
322MySQL  com‐
323              mand options.
324
325       ‐‐restore‐myloader‐options
326              Pass  the extra parameters during  the  Restore  if
327backup was done
328              by mydumper.
329
330       ‐‐‐‐ttmmppddiirr _t_e_m_p___d_i_r_e_c_t_o_r_y
331              Full  path  of the  directory  for  storing  tempo‐
332rary  files  and
333              directories  on  the backup host. The default is to
334use the sys‐
335              tem‐specified  temporary  directory  on  the backup
336host, e.g  /tmp.
337
338       ‐‐‐‐qquuiieett|‐‐‐‐nnoo‐‐qquuiieett
339              Choose  qquuiieett  to  suppress  display  of  log  mes‐
340sages on stdout.
341              Choose  nnoo‐‐qquuiieett  to  display  the  log messages to
342standard  output
343              (ssttddoouutt). The default is ‐‐‐‐nnoo‐‐qquuiieett.
344
345       ‐‐‐‐vveerrbboossee
346              Provide  more  detailed  output  in  the  log. Ver‐
347bose output is
348              turned off by default.
349
350       ‐‐‐‐hheellpp  Displays  the help message and  exits.  This  com‐
351mand  line  only
352              parameter cannot be specified in the  configuration
353file.
354
355EEXXAAMMPPLLEESS
356       For  restoring  backup  image  dated  18  Aug 2006 (backup
357image can be
358       either full or incremental backup):
359
360       mmyyssqqll‐‐zzrrmm     ‐‐‐‐aaccttiioonn     rreessttoorree      ‐‐‐‐ssoouurrccee‐‐ddiirreeccttoorryy
361//vvaarr//lliibb//mmyyssqqll‐‐zzrrmm//bbaacckk‐‐
362       uuppsseett11//2200006600881188112211553322
363
364       The   above   command  will restore all databases (full or
365incremental as
366       the case may be) that were backed up.
367
368       mmyyssqqll‐‐zzrrmm     ‐‐‐‐aaccttiioonn     rreessttoorree      ‐‐‐‐ssoouurrccee‐‐ddiirreeccttoorryy
369//vvaarr//lliibb//mmyyssqqll‐‐zzrrmm//bbaacckk‐‐
370       uuppsseett11//2200006600881188112211553322 ‐‐‐‐ddaattaabbaasseess ddbb11 ddbb22 ddbb33
371
372       The   above command does a selective restore of the speci‐
373fied databases.
374
375       mmyyssqqll‐‐zzrrmm        ‐‐‐‐aaccttiioonn        rreessttoorree        ‐‐‐‐bbiinn‐‐llooggss
376//vvaarr//lliibb//mmyyssqqll‐‐zzrrmm//bbaacckk‐‐
377       uuppsseett11//2200006600881188112211553322//mmyyssqqll‐‐bbiinn..[[00‐‐99]]**
378//vvaarr//lliibb//mmyyssqqll‐‐zzrrmm//bbaacckk‐‐
379       uuppsseett11//2200006600881199112211553322//mmyyssqqll‐‐bbiinn..[[00‐‐99]]**
380
381       The above command does a selective restore of  all  speci‐
382fied binary  log
383       files using a single MySQL server connection.
384
385
386
387FFIILLEESS
388       //vvaarr//lliibb//mmyyssqqll‐‐zzrrmm
389              Directory under which all backup data is stored.
390
391
392       //eettcc//mmyyssqqll‐‐zzrrmm//_b_a_c_k_u_p _s_e_t _n_a_m_e//mmyyssqqll‐‐zzrrmm..ccoonnff
393              Configuration file read by mmyyssqqll‐‐zzrrmm utility.
394
395
396RREETTUURRNN VVAALLUUEESS
397       On  success, zero is returned. On error, non‐zero value is
398returned.
399
400
401SSEEEE AALLSSOO
402       mysql‐zrm(1),          mysql‐zrm‐backup(1),         mysql‐
403zrm‐check(1),
404       mysql‐zrm‐list(1),   mysql‐zrm‐manage‐backup(1),    mysql‐
405zrm‐getconf(1),
406       mysql‐zrm‐setconf(1),  mysql‐zrm‐parse‐binlogs(1),  mysql‐
407zrm‐purge(1),
408       mysql‐zrm‐extract‐backup(1),                mysql‐zrm‐ver‐
409ify‐backup(1),
410       mysql‐zrm‐abort‐backup(1),                      mysql‐zrm‐
411scheduler(1),
412       mysql‐zrm‐reporter(1),   mysql‐zrm.conf(5),  mysqldump(1),
413mysqlbinlog(1),
414       mysql(1),  lvm(8),  Zmanda  Recovery  Manager   for  MySQL
415(http://mysql
416       backup.zmanda.com/)
417
418
419AAUUTTHHOORR
420       Zmanda Inc. (http://www.zmanda.com)
421
422
423
424Zmanda,  Inc.                    ZRM for MySQL             mysql‐
425zrm‐restore(1)
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
Impressum