Cloud Sync¶
Overview¶
After each successful backup, the orchestrator can automatically upload the archive to one or more cloud storage destinations. Supported providers:
| Provider | Auth method | SDK |
|---|---|---|
| Google Drive | OAuth2 service account | google-api-python-client |
| Dropbox | App access token | dropbox |
| OneDrive | OAuth2 client credentials | msal + REST |
Uploads run on the cloud Celery queue, in parallel with retention and notification tasks, so they do not block the next scheduled backup.
Adding a Cloud Account¶
Navigate to Cloud → Add Account, choose the provider, and follow the provider-specific setup below.
Google Drive¶
You need a service account with Drive access.
- In Google Cloud Console, create a project (or use an existing one).
- Enable the Google Drive API.
- Create a Service Account under IAM & Admin → Service Accounts.
- Download the JSON key file.
- Share the target Google Drive folder with the service account email (e.g.,
backup-agent@my-project.iam.gserviceaccount.com). Give it Editor access. - In the orchestrator, paste the full JSON key content into the Credentials JSON field.
- Enter the Folder ID — the long ID at the end of the folder's Drive URL.
Warning
The credentials JSON contains a private key and is stored Fernet-encrypted in the database. Never commit it to version control.
Dropbox¶
- Go to Dropbox App Console.
- Create an app with Full Dropbox or App Folder access (App Folder is more restrictive and recommended).
- Generate an Access Token on the app's settings page.
- In the orchestrator, paste the token into Access Token.
- Set the Remote path where backups will be uploaded (e.g.,
/odoo-backups/).
OneDrive¶
- Register an app in Azure Active Directory → App Registrations.
- Add the
Files.ReadWriteMicrosoft Graph permission and grant admin consent. - Create a Client Secret under Certificates & secrets.
- Note the Tenant ID, Client ID, and Client Secret.
- Enter these in the orchestrator's OneDrive account form along with the Remote path.
Binding a Cloud Account to an Instance¶
A cloud account must be bound to an instance before uploads happen.
- Open the Instance Detail page.
- Scroll to Cloud Sync Bindings.
- Click + Bind Cloud Account.
- Select the account, then configure:
| Option | Default | Description |
|---|---|---|
| Remote path | /odoo-backups/{instance_slug}/ |
Destination folder on the cloud |
| Enabled | on | Toggle to pause syncing to this destination |
| Remote retention: keep last N | — | Delete older remote files, keeping N most recent (leave blank to disable) |
You can bind the same cloud account to multiple instances with different remote paths, or bind multiple cloud accounts to one instance.
Remote Retention¶
When keep last N is set on a binding, after each successful upload the orchestrator lists the remote files for that instance path, sorts them by upload date, and deletes the oldest ones — keeping only N.
The same safety net that protects local backups applies here: if the deletion would remove all remote files, it is skipped and an audit entry is written.
Note
Remote retention is independent of local retention. You can keep 7 local backups and 30 remote ones, or vice versa.
Monitoring Sync Status¶
The Run History table shows a Cloud column with per-destination icons:
- ✓ — uploaded successfully
- ✗ — upload failed (hover for error)
- ↻ — upload pending or retrying
- — — no cloud binding configured
Open a run row to see the full cloud_sync_status JSON with per-account details.
Manual Re-upload¶
If an upload failed, click Re-upload on the run detail page. This enqueues a new cloud sync task for that specific run without re-running the backup itself.
Supported File Types¶
All archives produced by the orchestrator are uploaded as-is:
.zip— Odoo endpoint backups (includes filestore).dump— pg_dump custom-format database dump.tar.gz— pg_dump with filestore
Security Considerations¶
- All provider credentials (API keys, tokens, client secrets) are stored Fernet-encrypted in the database.
- The encryption key at
/data/secret.keymust be backed up independently — losing it means provider credentials cannot be recovered. - Uploads use HTTPS exclusively; no plain-HTTP cloud endpoints are supported.
- The service account / app registration should be granted the minimum required permissions (Files.ReadWrite, not admin-level Drive/OneDrive access).