Skip to main content

CLI for Odoo/Doodba database workflows.

Project description

dbodoo

Python CLI for Odoo/Doodba database workflows.

Automates remote backup, local restore via Docker Compose, and multi-environment management — always operating from the current working directory (Path.cwd()).

Installation

Isolated install with pipx (recommended):

pipx install dbodoo

Local development:

pipx install --editable .
# or
pip install -e .

Quick start

cd ~/projects/my-doodba-project

# 1. Download a backup from the remote server
dbodoo remote -b

# 2. Restore the downloaded ZIP into the local database
dbodoo remote -r

# 3. Or do both in one step
dbodoo remote -b -r

If .remotes.json does not exist yet, the configuration wizard starts automatically on the first command.


Commands

dbodoo init

Create or update .remotes.json with an interactive wizard.

dbodoo init

The wizard asks:

  1. Mode — determines which fields are required:
    • Backup + Restore — downloads the ZIP and restores locally (URL + password + dbname)
    • Backup only — downloads the ZIP only (URL + password + dbname)
    • Restore only — restores an existing ZIP (dbname only)
  2. Remote name (backup modes), database name, URL, and password

If .remotes.json already exists, the wizard offers to add another remote or overwrite the file. Use --force to overwrite without prompting.

Non-interactive (CI / scripts):

# Backup + Restore
dbodoo init --name prod --dbname prod \
            --remote-address https://client.odoo.com/ \
            --password masterpassword

# Restore-only (no URL or password needed)
dbodoo init --name prod --dbname prod

dbodoo remote -b

Download a backup ZIP from the remote Odoo server.

dbodoo remote -b
  • Connects to https://<remote_address>/web/database/backup
  • Shows a Rich progress bar during the download
  • Saves to ../<dbname>.zip (one level above the project root)
  • Distinct error messages for: timeout, connection failure, wrong password (Odoo returns HTML instead of a ZIP), HTTP 4xx/5xx

dbodoo remote -r

Restore the last downloaded ZIP into the local database via Docker Compose.

dbodoo remote -r

# Restore into a database other than 'devel' (the default)
dbodoo remote -r --destination-db staging
  • Expects the ZIP at ../<dbname>.zip — run -b first if it does not exist
  • Detects Docker Compose v2 (docker compose) with fallback to v1 (docker-compose)
  • Runs click-odoo-restoredb inside the odoo service via a read-only bind-mount
  • If the destination database already exists, asks whether to rerun with --force (drops and recreates the database) — never forces automatically
  • Emits a warning if the directory does not look like a Doodba project (missing markers), but does not block

dbodoo remote -b -r

Download a backup and restore it in a single step.

dbodoo remote -b -r

# With an explicit destination database
dbodoo remote -b -r --destination-db staging

If the download fails, the restore is never attempted.


dbodoo choose

Select and print a remote name (useful in scripts).

dbodoo choose

With a single remote configured, selection is automatic.


.remotes.json structure

The file lives at the project root, next to docker-compose.yml.

Backup + Restore / Backup only:

{
  "prod": {
    "remote_address": "client.odoo.com",
    "dbname": "prod",
    "password": "masterpassword"
  },
  "staging": {
    "remote_address": "staging.client.odoo.com",
    "dbname": "staging",
    "password": "masterpassword"
  }
}

Restore only (no remote connection required):

{
  "prod": {
    "dbname": "prod"
  }
}

URLs are normalised on save: https://client.odoo.com:8069/client.odoo.com:8069.


Project detection

dbodoo locates the project root by walking up from cwd, looking for:

  1. .remotes.json
  2. Doodba markers: common.yaml, docker-compose.yml, odoo/custom/src

Configuration is always local to the project — there is no global config file.


Troubleshooting

Backup ZIP not found

Error: Backup ZIP not found at /home/.../project.zip.
Run dbodoo remote -b first to download it.

Run dbodoo remote -b before attempting a restore.


Wrong master password

Error: Authentication failed for 'client.odoo.com'. The server returned
an HTML page instead of a ZIP. Check the master password.

Check the password in .remotes.json or run dbodoo init to update it.


Destination database already exists

Error: Destination database already exists: devel
⚠  click-odoo-restoredb exited with code 1.
? Rerun with --force? (drops and recreates the 'devel' database) (y/N)

Answer y to drop and recreate the database, or n to cancel without touching anything.


Docker Compose not found

Error: Docker Compose not found. Install Docker with the Compose plugin (v2)
or 'docker-compose' (v1).

Install Docker Desktop or the Compose plugin: apt install docker-compose-plugin.


Directory does not look like a Doodba project

Warning: This directory does not look like a Doodba project
(missing: common.yaml, docker-compose.yml, odoo/custom/src).
The Docker restore may not work as expected.

The restore continues, but may fail if the odoo service is not defined in docker-compose.yml. Run dbodoo from the Doodba project root.


.remotes.json not found

The remote command starts the configuration wizard automatically. To create the file manually:

dbodoo init

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbodoo-0.1.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbodoo-0.1.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file dbodoo-0.1.0.tar.gz.

File metadata

  • Download URL: dbodoo-0.1.0.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for dbodoo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 94b092458b0aefd21630d063f1bfa2ab0e6380cf3b1453ff0ccb2183430b3ef5
MD5 72d39fd23370cdf8a204025934e9e470
BLAKE2b-256 8dec04268c73b458ca28e231d5397b0b0cc82677b0b7b368a3efae9ee858b441

See more details on using hashes here.

File details

Details for the file dbodoo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dbodoo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for dbodoo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bfc57b139870156236d1d1b4075b51f573efb087ed8ec569e3c93fcc2217bfd
MD5 52647197fd33c022056ace48e960f0f5
BLAKE2b-256 3c17b16965373f74c376a088ef8bbc0be4017423d66d8af42fcf7ddd5febe9be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page