The Odoo Docker Database Backup and Restore Tool is a Python script designed to simplify the process of backing up and restoring Odoo databases running in Docker containers. This tool ensures that your Odoo database and filestore are safely backed up and can be restored efficiently.
- Backup Integrity Verification: Ensures that the backup file is valid and contains the necessary database dump.
- Container Management: Automatically detects and manages PostgreSQL and Odoo containers.
- Database Restoration: Handles the restoration of the database and filestore, including dropping and recreating the database if necessary.
- User Interaction: Provides a user-friendly interface for selecting backups and confirming actions.
- Error Handling: Includes robust error handling to manage common issues during the backup and restore process.
- Python 3.x
- Docker
- PostgreSQL
- Odoo
- Clone the repository:
git clone https://github.com/pro-777/odoo-docker-backup-restore.git cd odoo-backup-backup-restore
-
Backup:
-
Ensure that your Odoo and PostgreSQL containers are running.
-
Place the backup script in a directory of your choice.
-
Run the backup script:
./odoo_backup
-
Follow the on-screen instructions to create a backup of your Odoo database and filestore.
-
-
Restore:
-
Ensure that your Odoo and PostgreSQL containers are running.
-
Place the restore script in a directory of your choice.
-
Run the restore script:
./odoo_restore
-
Follow the on-screen instructions to select a backup and restore your Odoo database and filestore.
-
The backup script performs the following steps:
- Detect Containers: Identifies the running PostgreSQL and Odoo containers.
- Create Backup: Creates a backup of the Odoo database and filestore.
- Save Backup: Saves the backup file to a specified directory.
The restore script performs the following steps:
- Detect Containers: Identifies the running PostgreSQL and Odoo containers.
- Select Backup: Lists available backups and allows the user to select one for restoration.
- Verify Backup: Verifies the integrity of the selected backup file.
- Stop Odoo Container: Stops the Odoo container to ensure a safe restoration process.
- Restore Database: Drops the existing database (if it exists) and restores the database from the backup.
- Restore Filestore: Restores the filestore from the backup.
- Start Odoo Container: Starts the Odoo container after the restoration is complete.
- Cleanup: Cleans up temporary files used during the restoration process.
./odoo_backup Follow the on-screen instructions to create a backup of your Odoo database and filestore.