db-export
Usageβ
dvs db-export [--optimized|--parallel|--compressed|--dump]
Exports the database to the application directory.
Optionsβ
| Option | Description | Output |
|---|---|---|
--optimized | Auto-detection based on database size (default) | .sql.gz or .tar.gz |
--parallel | Split tables for parallel import | .tar.gz (multi-files) |
--compressed | Single SQL file compressed | .sql.gz |
--dump | Single SQL file uncompressed | .sql |
Optimized mode (default)β
Automatically selects the best mode based on database size:
- Database > 100 MB β parallel mode
- Database < 100 MB β compressed mode
$ dvs db-export
Mode: compressed (database < 100 MB)
Database myapp exported to myapp-20251215-105844.sql.gz
Parallel modeβ
Exports the database structure separately from the data (one file per table), enabling parallel import for faster restoration of large databases.
$ dvs db-export --parallel
Mode: parallel
Database myapp exported to myapp-20251215-105844-parallel.tar.gz
The parallel archive contains:
__00_schema.sql- Database structure (tables, indexes, etc.)tablename.sql- Data for each table
note
Parallel mode is optimized for large databases. For small databases, the overhead may make it slower than compressed mode.
Compressed modeβ
Creates a single SQL dump compressed with gzip.
$ dvs db-export --compressed
Mode: compressed
Database myapp exported to myapp-20251215-105844.sql.gz
Dump modeβ
Creates a single uncompressed SQL file.
$ dvs db-export --dump
Mode: dump
Database myapp exported to myapp-20251215-105844.sql
See alsoβ
db-import