How to restore an Odoo backup - coopdevs/handbook GitHub Wiki
Aquest handbook està descontinuat. La nova adreça és: https://handbook.coopdevs.org/ca/home |
If you have access to the inventory of the odoo instance you want to restore, you can use the restore playbook of odoo-provisioning. For more details, visit restore playbook of backups-role.
Note that the restore-to-controller
task list is intended to install restic and download it in the same machine where you execute ansible, i.e., the controller. If you want to restore it to the source server, you can use the restore-to-host
task file to create a simple playbook
- Backblaze bucket
- name
- associated application key_id
- associated application key
- Restic repository
- path within the bucket
- encryption passphrase
- Odoo DB master password
-
Install restic on your workstation and check it executing
restic version
- Set environment variables:
export RESTIC_REPOSITORY='b2:BUCKET_NAME:REPO_PATH'
export RESTIC_PASSWORD='p4ssw0rD'
export B2_ACCOUNT_ID='MY_APPLICATION_KEY_ID'
export B2_ACCOUNT_KEY='MY_SECRET_ACCOUNT_KEY'
- Browse snapshots with
restic snapshots
and select which snapshot you want to restore. - Download snapshot file to your workstation with
restic restore $SNAPSHOT_ID .
- Check that the file is inside your working path inside a tree like './opt/backup/.tmp/odoo-backup.zip'.
WARNING, a better procedure must be studied, one that only deletes current db once the restore is checked. However, it involves database name and must be tested
- Go to your Odoo instance db admin page looking like
https://my_odo.org/web/database/manager
- Delte your current db inputting db master password
- Restore the backup by inputitng the previous database name, db master password, and selecting the zip to restore
- Check results
- Database manager webpage shows your db again with no warnings or errors
- Log in to your odoo instance and check that you have restored the state you wished
The -l option gives the file size
restic ls -l <snapshot>
View the files inside the backup with then name
restic ls -l <snapshot> <file>
restic restore <snapshot> --target <backup destination folder> --include <file to download>