Table of Contents

Windows Restore Script

This script is designed to automate the process of restoring a PostgreSQL database and a filestore for an Odoo instance. It extracts the latest backups of the database, filestore, and extra-addons, decompresses them, and then restores the database while updating the admin password.

Prerequisites

Before running the script, ensure that the following prerequisites are met:

1. Configuration Loading

2. Displaying Loaded Configurations

3. Checking WinRAR Installation

4. Finding Latest Backup Files

5. Displaying Latest Backup Files

6. Extracting Extra Add-ons

7. Defining Target Directory for Filestore Extraction

8. Extracting Filestore Backup

9. Checking and Creating Database

10. Checking and Creating PostgreSQL Role

The script checks if the PostgreSQL role 'odoo' exists. If it doesn't, it creates the role with the login password 'odoo'.

11. Decompressing Database Backup

The script decompresses the latest database backup file (LATEST_DATABASE) to a temporary location (temp_db_backup.sql).

12. Restoring Database

The script restores the database from the decompressed SQL file.

13. Changing Admin Password

The script changes the admin password in the restored database to the one specified in the configuration (ADMIN_PASSWORD).

14. Cleanup

The script deletes the temporary database backup file after restoration is complete.

15. Completion

Finally, the script indicates the completion of the restoration process.


Nadir Habib 2024/04/26 17:37