Commandscc db
cc db restore
Restore a PostgreSQL database from its cc copy (<db_name>-CC-COPY). The original
database is dropped and recreated from the copy.
Usage
cc db restore <name>
cc db restore # detect the DB from the active environmentArguments
| Argument | Description |
|---|---|
name | Database to restore (tab-completable). If omitted, cc detects it from the version path's settings.json / launch.json. |
What it does
- Routed through the daemon (direct connection or
docker exec): it verifies the<name>-CC-COPYtemplate exists in live Postgres before dropping the target, thenCREATE DATABASE … TEMPLATEthe copy. Works on a dockerized Postgres too. - You must run
cc db copyfirst. If no copy exists, the command aborts before touching the target.
Examples
cc db restore my_project_v17
# → Drops my_project_v17, restores from my_project_v17-CC-COPY
cc db restore
# → Detects the DB from the active environment and restores itRelated
cc db— database group overviewcc db copy— create the copy this restores fromcc db backup— named, file-based snapshots