Skip to main content

db-export

Usage​

dvs db-export [--optimized|--parallel|--compressed|--dump]

Exports the database to the application directory.

Options​

OptionDescriptionOutput
--optimizedAuto-detection based on database size (default).sql.gz or .tar.gz
--parallelSplit tables for parallel import.tar.gz (multi-files)
--compressedSingle SQL file compressed.sql.gz
--dumpSingle 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