Hibou Roost - Odoo: Odoo Database Management: Database Restore
Purpose
This document outlines two methods you can use to restore your Odoo database.
Process
Odoo Database Manager
Odoo has a database manager that may be accessed via the route /web/database/manager
To use it, you will need the so called 'master password' of the installation. You can use the database manager with a regular browser, and has a built in way to restore a database.
Hibou Flow Restore
Hibou Flow is built into our Suite containers, and containers built from Suite (customer images). There are numerous command line flags, but only a couple are typically needed to interact with it.
While Flow has its own entrypoint (/flow/entrypoint.sh), using Suite's is generally better as it will provide database connection details out of the Odoo RC file (/etc/odoo/odoo.conf).
The simplest possible scenario would be if you have a file at /tmp/backup.zip and you either want to restore into a database in your /etc/odoo/odoo.conf file (the db_name key) or will use the -d desired_db_name (used below)
/entrypoint.sh flow odoo-restore -d desired-db-name
If you do not have the backup locally, you can get them out of S3 using credentials, or from a direct URL (e.g. a short term use S3 share URL). Always put single apostrophe characters ' ' around URL's to ensure they work correctly.
In the following command the \ character is used to make a single command on multiple lines for legibility.
Additionally:
'--finished_file keep' is used to keep the backup file after downloading it from Minio/S3.
'--restore_test 1' is used to execute some SQL, namely to archive all scheduled actions and disable email.
Find all options in the source https://gitlab.com/hibou-io/hibou-odoo/flow/-/blob/master/odoo/restore.py
/entrypoint.sh flow odoo-restore -d prod-2020-12-31 \
--backup_src 'https://some/very/long/url'
--finished_file keep \
--restore_test 1
# OR
/entrypoint.sh flow odoo-restore -d prod-2020-12-31 \
--backup_src 's3://client-backups/abc-prod-2020-12-31.zip' \
--backup_minio_host ca-b1.hiboucorp.com \
--backup_minio_access_key minio \
--backup_minio_secret_key miniokey \
--backup_minio_secure 1 \
--finished_file keep \
--restore_test 1