Skip to content

A Docker image for backing up Odoo database (with filestore) to Amazon S3 and restoring it

License

Notifications You must be signed in to change notification settings

techspawn/odoo-backup-restore-s3

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

odoo-backup-restore-s3

Authors:

Backup Odoo databases (with filestore) to S3 and restore them upon request. Supported Odoo versions: 8, 9, 10, 11. Docker Repository on Quay

Backup usage examples

Docker:

$ docker run --link odoo --network=<odoo network> -e AWS_ACCESS_KEY_ID=<key> -e AWS_SECRET_ACCESS_KEY=<secret> -e S3_BUCKET=<my-bucket> -e S3_PREFIX=<backup> -e ODOO_MASTER_PASSWORD=<password> -e DATABASES=<comma-separated list of database names> -e SCHEDULE=<backup frequency> quay.io/avoinsystems/odoo-backup-restore-s3

Docker Compose:

odoo:
  image: odoo

backup:
  image: quay.io/avoinsystems/odoo-backup-restore-s3
  depends_on:
    - odoo
  environment:
    SCHEDULE: '@daily'
    AWS_REGION: region
    AWS_ACCESS_KEY_ID: key
    AWS_SECRET_ACCESS_KEY: secret
    S3_BUCKET: my-bucket
    S3_PATH: backup
    DATABASES: dbname1,dbname2
    ODOO_MASTER_PASSWORD: password

Restore usage examples

Docker:

$ docker run --link <odoo> --network=<odoo network> -e AWS_ACCESS_KEY_ID=<key> -e AWS_SECRET_ACCESS_KEY=<secret> -e S3_BUCKET=<my-bucket> -e S3_PREFIX=<backup> -e ODOO_MASTER_PASSWORD=<password> -e DATABASES=<database to be created from the backup> -e SCHEDULE=<backup frequency> quay.io/avoinsystems/odoo-backup-restore-s3 restore

Docker Compose:

$ docker-compose run --rm -e DATABASES=<database to be created from the backup> backup restore

Configuration

Configuration options can be passed as environment variables.

Variable Purpose Default
ODOO_HOST Odoo container hostname odoo
ODOO_PORT Odoo container port 8069
ODOO_MASTER_PASSWORD Odoo master password admin
ODOO_VERSION Odoo version number (8, 9, 10 or 11) 11
DATABASES A single database or comma-separated list of databases
AWS_ACCESS_KEY_ID Amazon AWS Access Key ID
AWS_SECRET_ACCESS_KEY Amazon AWS Secret Access Key
AWS_REGION The default AWS region
S3_BUCKET Amazon AWS S3 bucket name
S3_PATH The backup path inside the bucket, a.k.a. prefix backup
RESTORE_FILENAME Which backup file to restore. Only used when restoring backup. If empty, the latest backup will be restored
SCHEDULE Backup frequency. single = backup only once. See all available options here. single
CHECK_URL A URL to call with a GET request after a successful backup
PROTOCOL The protocol to use (xmlrpc, http). HTTP is more memory-efficient. xmlrpc

About

A Docker image for backing up Odoo database (with filestore) to Amazon S3 and restoring it

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 73.9%
  • Shell 26.1%