backup_database#

ADR.backup_database(output_directory: str | Path = '.', *, database: str = 'default', compress: bool = False, ignore_primary_keys: bool = False) None#

Create a JSON (optionally gzipped) backup of an ADR database.

Parameters:
output_directorystr or Path, default: “.”

Directory in which to place the backup file.

databasestr, default: “default”

ADR database alias to back up.

compressbool, default: False

If True, write a .json.gz file instead of plain JSON.

ignore_primary_keysbool, default: False

If True, use --natural-primary to ignore primary key values and rely on natural keys instead.

Raises:
ADRException

If in-memory mode is active, the target DB is not configured, the output directory is invalid, or the backup command fails.