Skip to Content
Restore Odoo from S3

Restore Odoo from S3

Restore Odoo backup from Amazon S3

https://tower.cetmix.com/web/image/product.template/14/image_1920?unique=04111dd
(0 review)
Summary
Categories
Commands
Tags
Odoo Backup Amazon S3
Authors
Cetmix OU
License AGPL-3
Version 1.0.0
Call sign cx_command_restore_odoo_from_s3
Website https://cetmix.com/contactus
Download
16 downloads

This YAML snippet defines a Cetmix Tower command to restore an Odoo database backup from an Amazon S3 bucket. It is designed to run inside an Odoo Docker container and supports dynamic container configuration and optional database neutralization (sanitization) for staging or test environments.

Important

You must add the following policy for the user you are using to restore backups:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:ListBucket"],
"Resource": "arn:aws:s3:::<your_bucket_name>"
},
{
"Effect": "Allow",
"Action": ["s3:GetObject"],
"Resource": "arn:aws:s3:::<your_bucket_name>/*"
}
]
}

🏗️ Architecture Components

1. Execution Layer

  • Command Type: ssh_command

  • Execution Context: Temporary Odoo Docker container

  • User Privileges: Root inside container

  • Parallel Execution: ❌ Not allowed

  • Docker Runtime: Detached, self-cleaning on completion

  • Exit Handling: Fails immediately on error

☁️ Storage Layer

Amazon S3 Integration

  • Operations Used:

    • s3:GetObject

    • s3:ListBucket

  • Permissions: Must grant the above actions to the S3 bucket

  • Download Path: Backup file is copied from:

    php-template
    CopyEdit
    s3://<bucket>/<path>/<backup_file_name>.zip

🐘 Odoo Configuration

  • Database Restore Tool: Uses click-odoo-restoredb

  • Docker Configuration:

    • Joins defined Docker network or uses --link fallback

    • Injects DB settings into /etc/odoo.conf

  • Database Neutralization:

    • Optional (--neutralize)

    • Works with Odoo 16.0 and newer

  • Backup Cleanup:

    • Removes backup file after restore

🔁 Workflow Summary

  1. Install AWS CLI inside container

  2. Configure Odoo with DB credentials

  3. Download backup file from S3

  4. Restore using click-odoo-restoredb

  5. Optionally neutralize restored DB

  6. Delete backup file from disk

This package is distributed under the GNU Affero General Public License v3.0 (AGPL-3) or later license.