Appearance
metaplay database export-snapshot
Export database snapshot from an environment
Appearance
Export database snapshot from an environment
metaplay database export-snapshot [ENVIRONMENT] [OUTPUT_FILE] [flags] Export a database snapshot from the specified environment into a file.
DISCLAIMER: This operation is not a real backup and is intended for ad hoc database exports only. This operation should only be used for relatively small databases as it copies the entire database to the machine running the CLI.
The generated snapshot is a zip file containing metadata about the snapshot and a compressed SQL dump for each shard, generated by mariadb-dump. The format of the snapshot is subject to change in the future.
This command starts a temporary debug pod and runs mariadb-dump inside it, connects to the read-only replica of each shard of the database and creates a complete snapshot.
WARNING: It is DANGEROUS to export a database while a game server is deployed. When exporting a database that is under load, it is possible for the database server's purge queue to start growing unboundedly. Do not use the --force on a database with non-trivial load on it!
Expected arguments:
Related commands:
# Export database from 'nimbly' environment (uses default filename)
metaplay database export-snapshot nimbly
# Export database to a specific file
metaplay database export-snapshot nimbly my_database_snapshot.mdb--force: Proceed with export even if a game server is deployed (DANGEROUS!)--color <string>: Should the output be colored (yes/no/auto)? [env: METAPLAYCLI_COLOR] (default: auto)--project <string>: Path to the to project directory (where metaplay-project.yaml is located)--skip-version-check: Skip the check for a new CLI version being available--verbose: Enable verbose logging, useful for troubleshooting [env: METAPLAYCLI_VERBOSE]