Introduction¶
Snapshotting your database is a fundamental feature of DBSnapper, allowing you to create a point-in-time snapshot or backup of your database. Snapshotting takes a full copy of your database, including the schema and data, and stores it in a compressed file. This snapshot can then be used to restore your database to the state it was in when the snapshot was taken.
Overview¶
DBSnapper provides the build
and load
commands to create and restore a snapshot of your database.
build
command steps¶
- Connect to database specified by the
src_url
in the target definition - Invoke the database vendor's database dump command to create a snapshot of the database
- Compress the snapshot file and store it in the working directory
load
command steps¶
- Find the requested snapshot file in the working directory
- Decompress the snapshot file
- Connect to the database specified by the
dst_url
in the target definition - Drop and recreate the database
- Invoke the database vendor's database restore command to restore the snapshot to the database
Required Dependencies¶
DBSnapper uses database vendor tools to perform snapshot operations.
Database Vendor | build command |
load command |
queries |
---|---|---|---|
PostgreSQL | pg_dump |
pg_restore |
psql |
MySQL | mysqldump |
mysql |
mysql |