Skip to main content
Version: Nightly

Metadata Export & Import

The Export and Import tools provide functionality for backing up and restoring GreptimeDB metadata. These tools allow for metadata backup and restoration operations.

Export Tool

Command Syntax

greptime cli meta snapshot save [OPTIONS]

Options

OptionRequiredDefaultDescription
--store-addrsYes-Metadata storage service addresses to connect to (only supports etcd MySQL PostgreSQL) format consistent with store-addrs in metasrv configuration
--backendYes-Type of metadata storage backend, one of etcd-store, postgres-store, mysql-store
--store-key-prefixNo""Unified prefix for data in metasrv, refer to metasrv configuration
--meta-table-nameNogreptime_metakvWhen backend is one of postgres-store, mysql-store, the table name storing metadata
--max-txn-opsNo128Maximum number of txn operations
--file-nameNometadata_snapshotFile name for metadata export, will automatically add .metadata.fb suffix
--output-dirNo""Directory to store exported data
--s3NofalseWhether to use s3 as storage medium for exported data
--s3-bucketNo-Valid when s3 is true, s3 bucket name
--s3-regionNo-Valid when s3 is true, s3 region name
--s3-access-keyNo-Valid when s3 is true, s3 access key name
--s3-secret-keyNo-Valid when s3 is true, s3 secret key name
--s3-endpointNo-Valid when s3 is true, s3 endpoint name, defaults based on bucket region, generally not needed

Import Tool

Command Syntax

greptime cli meta snapshot restore [OPTIONS]

Options

OptionRequiredDefaultDescription
--store-addrsYes-Metadata storage service addresses to connect to (only supports etcd MySQL PostgreSQL) format consistent with store-addrs in metasrv configuration
--backendYes-Type of metadata storage backend, one of etcd-store, postgres-store, mysql-store
--store-key-prefixNo""Unified prefix for data in metasrv, refer to metasrv configuration
--meta-table-nameNogreptime_metakvWhen backend is postgres-store, mysql-store, the table name storing metadata
--max-txn-opsNo128Maximum number of txn operations
--file-nameNometadata_snapshot.metadata.fbFile name of metadata export to import, will automatically add .metadata.fb suffix
--input-dirNo""Directory storing exported data
--s3NofalseWhether to use s3 as storage medium for exported data
--s3-bucketNo-Valid when s3 is true, s3 bucket name
--s3-regionNo-Valid when s3 is true, s3 region name
--s3-access-keyNo-Valid when s3 is true, s3 access key name
--s3-secret-keyNo-Valid when s3 is true, s3 secret key name
--s3-endpointNo-Valid when s3 is true, s3 endpoint name, defaults based on bucket region, generally not needed
--forceNofalseWhether to force import, when target backend is detected to not be in a clean state, import is disabled by default, enable this flag to force import