mxrestore

This document describes the data restoration tool mxrestore.

1 Description

  • mxrestore is used to restore data backed up by the mxbackup tool.
  • mxrestore supports restoring data that was backed up to S3 object storage using mxbackup.

2 Parameter Information

Parameter Description
--backup-dir directory Absolute path to the backup data to be restored
--create-db Create the database before restoring data
--data-only Restore only table data, not metadata
--debug Output debug-level log messages
--exclude-schema schema Schema to exclude during restore; this parameter can be specified multiple times for multiple schemas
--exclude-schema-file file File containing a list of schemas to exclude
--exclude-table table Table to exclude during restore; this parameter can be specified multiple times for multiple tables
--exclude-table-file file File containing a list of tables to exclude
--help Show help information
--include-schema schema Specify schema to include in restore; can be used multiple times for multiple schemas
--include-schema-file file File listing schemas to include in restore
--include-table table Specify table to include in restore; can be used multiple times for multiple tables
--include-table-file file File listing tables to include in restore
--incremental Incremental restore, applicable to AO tables
--jobs num Number of concurrent connections during restore; default is 1
--metadata-only Restore only metadata, not table data
--on-error-continue Log errors and continue restoration upon encountering issues
--plugin-config file Specify the location of the plugin configuration file
--quiet Suppress all non-warning, non-error log messages
--redirect-db db Restore data into the specified database instead of the original one used during backup
--redirect-schema schema Restore data into the specified schema instead of the original one used during backup
--run-analyze Run ANALYZE on restored tables
--timestamp timestamp Timestamp to identify the backup to restore, format: YYYYMMDDHHMMSS
--truncate-table Truncate existing data in tables being restored
--verbose Print detailed log messages
--version Print tool version and exit
--with-globals Restore global metadata
--with-stats Restore statistics

3 Examples

Restore the backup with timestamp /home/mxadmin/backup from directory 20210820143820. ``


$ mxrestore --backup-dir /home/mxadmin/backup --timestamp 20210820143820
``

Restore data backed up by `mxbackup` in S3 object storage.
``
```bash
$ mxrestore --timestamp 20221208185654 --plugin-config /tmp/s3-config-file.yaml
``

>***Note!***  
The log file directory for the `mxbackup` tool is `<gpadmin_home>/gpAdminLogs/gpbackup_s3_plugin_timestamp.log`, where the timestamp format is `YYYYMMDDHHMMSS`.

>***Note!***  
For more information about backup and restore operations in YMatrix, see [Backup and Restore](/en/doc/4.8/maintain/backup_restore). For details on using the S3 object storage plugin with `mxbackup`, refer to [mxbackup](/en/doc/4.8/tools/mxbackup).