MYSQL-ZRM-RESTORE(1)

📦 version 3.0, in epel 9, fedora 43, fedora 44

💖 mysql-zrm-restore — bestie's guide to ZRM for MySQL recovery 💖

okay so this is mysql-zrm-restore(1) and babes, it's the glow-up-your-database tool. welcome. 🎀


✨ NAME ✨

mysql-zrm-restore — the Recovery utility for ZRM for MySQL. she brings your data back. periodt. 💅


🌈 SYNOPSIS 🌈

mysql-zrm-restore
                [--backup-set name]
                [--source-directory directory name]
                [--bin-logs "/fullpath/name1 /fullpath/name2 ..."]
                [--mysql-shutdown | --no-mysql-shutdown]
                [--retry-count count]
                [--retry-delay seconds]
                [--replication|--noreplication]
                [--all-databases]
                [--databases "name1 name2 ..."]
                [--start-position #]
                [--stop-position #]
                [--offset #]
                [--start-datetime name]
                [--stop-datetime name]
                [--copy-plugin plugin]
                [--ssh-user user]
                [--ssh-identity-file filename]
                [--socket-remote-port port]
                [--passfile filename]
                [--user user]
                [--password password]
                [--host hostname]
                [--port portnumber]
                [--socket name]
                [--ssl-options "MySQL ssl options"]
                [--device-fs-map mapfilename]
                [--dismount-existing]
                [--mysql-binpath location of MySQL commands]
                [--compress-data-during-transport]
                [--pre-restore-plugin plugin]
                [--post-restore-plugin plugin]
                [--tmpdir temp_directory]
                [--options-file filename]
                [--restore-myloader-options "--overwrite-tables --enable-binlog ...."]
                [--quiet|--no-quiet]
                [--verbose]
                [--help]

🦋 DESCRIPTION 🦋

So like, recovering all different kinds of MySQL databases? That's literally what the mysql-zrm-restore utility is for. Use her to fully restore the database, or selectively restore it — on the same system or on another system entirely. flexible queen. ✨

ngl bestie, you should go look at the ZRM for MySQL documentation (http://mysql-backup.zmanda.com/) for the procedures on how to configure and use ZRM for MySQL. iykyk. 📖

When you're restoring backed up databases, you use either the --all-databases option or the --databases option. pick one, not both, bestie. 🙈

When the backup contains only specific tables from a database, you need to specify mysql-zrm action as restore and the database name to restore the backed up tables. Tables that are not included in the backup but are present in the database will be left untouched — she doesn't touch what she wasn't asked to touch. 💅


👑 OPTIONS 👑

  • --backup-set name — Specify the backup-set for the backup run. This is a Command line option only and it cannot be specified in the configuration file. The default value is BackupSet1. If such a value is already present, it will be used. no notes. 🎀
  • --source-directory directory name — Choose the directory containing a backup. This option is ignored when the backup action is specified. For the restore action, both source-directory and bin-logs options should not be specified. If both are present, the utility will return an error. 😭
  • --bin-logs "fullpathname1 fullpathname2 ..." — List binary log files, along with their full paths, to be used for restore. For the restore action, both source-directory and bin-logs options should not be specified. The utility will throw an error if both are specified. fr fr, pick one.
  • --mysql-shutdown | --no-mysql-shutdown — This specifies whether the mysql server should be shut down during the restore. If it's 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 recommended not to use the --no-mysql-shutdown option, because it can result in unexpected problems. bestie please. 😭
  • --retry-count count — 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. 💫
  • --retry-delay delay in seconds — This specifies the time in seconds between 2 retrys. The default value is 5 seconds. she waits. patiently. 🧚
  • --all-databases — Opt for all databases to be backed up or restored. This is the default if database or databases are not specified. queen of "just do everything". 👑
  • --databases "name1 name2 ..." — List the databases to backup or restore.
  • --replication | --noreplication — Choose replication to restore replication files. They will be restored only if the host is a replication slave. Default option is --noreplication. 💜
  • --start-position N — Fix the start position N for selective restore of all events after log position N. Log position can be determined using the parse-binlogs action.
  • --stop-position N — Stop selective restore of all events before log position N. Log positions can be determined using the parse-binlogs action.
  • --offset N — Skip the first N entries of the first binary log file in the bin-logs parameter. bye girl 👋
  • --start-datetime datetime — Start selective restore from the 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. format matters bestie 💅
  • --stop-datetime datetime — Selective restore till the 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.
  • --copy-plugin plugin — Specify the plugin along with its full pathname to be used for transferring 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 mysqlhotcopy (MySQL command) and copy the data from the remote machine
    4. restore data to a remote machine using mysqlhotcopy (MySQL command)

This parameter is optional. 🌸

  • --ssh-user user — 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. 🔐
  • --ssh-identify-file filename — 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. 🔑
  • --socket-remote-port port — 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. 🧦
  • --passfile file — The file containing the passphrase for encryption. This parameter is used only by the encrypt-plugin.pl. If not specified, the value used is /etc/mysql-zrm/.passphrase. This parameter is optional. 🤫
  • --user user — Specify the MySQL backup/restore user.
  • --password password — Specify the password for the MySQL user.
  • --host hostname — Specify the MySQL server host name or IP name.
  • --port portnumber — Specify the MySQL server port.
  • --socket name — Specify the socket file to use for communication with the MySQL server.
  • --ssl-options "MySQL ssl options" — Set any --ssl* options that MySQL supports. Refer to the MySQL Documentation for SSL options details. secure girlie 💅
  • --mysql-binpath mysql_binaries_dir — Set the full path where MySQL binaries are installed. For example: /opt/lampp/bin 📍
  • --compress-data-during-transport — If the value is set to 1, the image being restored is compressed when it's transferred from the ZRM server to the restore destination. Setting the value to zero, no compression is performed. No compression is performed by default. Data compression during transfer is independent of the Backup image compression parameter. two different things bestie, don't mix them up 🫶
  • --pre-restore-plugin plugin
  • --post-restore-plugin plugin

(Optional) Specify the plugin along with its full pathname to be called before a full or incremental restore is started (pre-restore-plugin), or after a restore is completed (post-restore-plugin). The plugins is executed on the ZRM server. The plugins are called with the following parameters:

  • --source-directory — The directory containing the backup image being restored.
  • --bin-logs — The list of binary logs to be parsed. Either source-directory or bin-logs is passed as parameter.
  • --backup-level — Backup level: full (0) or incremental (1).
  • --mysql-shutdown — This parameter is passed if the MySQL server was shutdown.
  • --zrm-error error code — 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. don't be silent about your problems bestie, communicate. 💀
  • --options-file filename — Set the file along with its full pathname that contains MySQL command options.
  • --restore-myloader-options — Pass the extra parameters during the Restore if the backup was done by mydumper. 🚚
  • --tmpdir temp_directory — Full path of the directory for storing tempo

okay so continuing the options vibe check, bestie — for the temp file situation: temporary files and directories on the backup host. The default is to use the system-specified temporary directory on the backup host, e.g /tmp. 💅

  • ‐‐quiet|‐‐no‐quiet — choose quiet to suppress display of log messages on stdout. choose no‐quiet to display the log messages to standard output (stdout). The default is ‐‐no‐quiet. no cap, it's that simple. 🎀
  • ‐‐verbose — provide more detailed output in the log. Verbose output is turned off by default. so if you want the tea, turn it on. ☕
  • ‐‐help — displays the help message and exits. This command line only parameter cannot be specified in the configuration file. so don't try to put it in the conf, bestie, it won't work. 💀

🌸 EXAMPLES 🌸

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

mysql‐zrm ‐‐action restore ‐‐source‐directory /var/lib/mysql‐zrm/backupset1/20060818121532

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

mysql‐zrm ‐‐action restore ‐‐source‐directory /var/lib/mysql‐zrm/backupset1/20060818121532 ‐‐databases db1 db2 db3

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

mysql‐zrm ‐‐action restore ‐‐bin‐logs /var/lib/mysql‐zrm/backupset1/20060818121532/mysql‐bin.[0‐9]* /var/lib/mysql‐zrm/backupset1/20060819121532/mysql‐bin.[0‐9]*

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

🎀 FILES 🎀

  • /var/lib/mysql‐zrm — directory under which all backup data is stored. like, all the goods live here. 🏠
  • /etc/mysql‐zrm/backup set name/mysql‐zrm.conf — configuration file read by mysql‐zrm utility. yes, the space in "backup set name" is literally in the manpage, bestie. don't @ me. 💅

🌈 RETURN VALUES 🌈

On success, zero is returned. On error, non‐zero value is returned. so zero = slay, non-zero = not slay. 💀

🦋 SEE ALSO 🦋

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/) iykyk. 💖

👑 AUTHOR 👑

Zmanda Inc. (http://www.zmanda.com) — they made this, bestie. show some love. 💖


this page is from Zmanda, Inc. — ZRM for MySQL — mysql‐zrm‐restore(1). no date in the footer, but it's giving timeless manual energy. 💅✨

📦 where this page comes from