Commandscc db
cc db init
Create a database from a zip dump file found in your configured download directory.
Usage
cc db init # pick a dump from the download directory
cc db init <file_name> # fuzzy-match a dump by name
cc db init -n my_db # set the new database name
cc db init -p ~/dumps # search a custom directory for dumpsArguments
| Argument | Description |
|---|---|
file_name | Dump to use. Fuzzy-matched against zips in the search directory; prompts if several match. Omit to pick from a list (newest first). |
Flags
| Flag | Description |
|---|---|
-n, --name | Name for the new database. If omitted, cc suggests one from the dump filename and lets you accept or edit it. |
-p, --path | Directory to search for dumps. Defaults to the configured download path. |
What it does
- Looks in the search directory (
--path, else the configured download path) for.zipdump files. Only zips containing adump.sqlare considered valid. - Selects the dump — by fuzzy name match, or from a newest-first picker.
- Prompts for the target database name (suggested from
--nameor the filename). - Extracts the zip, then drops + recreates the database and loads
dump.sqlthrough the daemon — directly or viadocker exec -i psqlfor a dockerized Postgres. - Runs the cleanup SQL afterwards (neutralizes mail servers, crons, etc.).
- Copies the dump's
filestore/to~/.local/share/Odoo/filestore/<db_name>for a native Odoo. For a dockerized Postgres the host filestore copy is skipped (its filestore lives in the container/volume).
Configure the download directory
cc configPick the download path from the settings picker and set it to the folder where you
save dump files (e.g. ~/Downloads). Or pass --path per invocation.
Dump format
cc expects the standard Odoo backup zip:
backup.zip
├── dump.sql
└── filestore/ (optional)Related
cc db— database group overviewcc db use— make the new database activecc db backup— named snapshots (separate from dumps)cc config— set the download path