Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
user:nadir [2023/07/29 22:38] – nadir | user:nadir [2023/12/27 11:35] (current) – nadir | ||
---|---|---|---|
Line 146: | Line 146: | ||
This guide provides step-by-step instructions for installing Docker on Debian. | This guide provides step-by-step instructions for installing Docker on Debian. | ||
- | ===== Prerequisites | + | === Prerequisites === |
* A Debian-based system | * A Debian-based system | ||
* Administrative privileges (sudo access) | * Administrative privileges (sudo access) | ||
- | ===== Step 1: Update Package Index ===== | + | === Step 1: Update Package Index === |
Open a terminal and update the package index on your Debian system: | Open a terminal and update the package index on your Debian system: | ||
Line 159: | Line 159: | ||
</ | </ | ||
- | ===== Step 2: Install Dependencies | + | === Step 2: Install Dependencies === |
Install the necessary packages to enable APT to use repositories over HTTPS and handle certificates: | Install the necessary packages to enable APT to use repositories over HTTPS and handle certificates: | ||
Line 167: | Line 167: | ||
</ | </ | ||
- | ===== Step 3: Add Docker' | + | === Step 3: Add Docker' |
Download and add Docker' | Download and add Docker' | ||
Line 175: | Line 175: | ||
</ | </ | ||
- | ===== Step 4: Add Docker Repository | + | === Step 4: Add Docker Repository === |
Add the Docker repository to your APT sources by creating a new file: | Add the Docker repository to your APT sources by creating a new file: | ||
Line 184: | Line 184: | ||
</ | </ | ||
- | ===== Step 5: Update Package Index Again ===== | + | === Step 5: Update Package Index Again === |
Update the package index to reflect the newly added Docker repository: | Update the package index to reflect the newly added Docker repository: | ||
Line 192: | Line 192: | ||
</ | </ | ||
- | ===== Step 6: Install Docker | + | === Step 6: Install Docker === |
Install Docker on your Debian system: | Install Docker on your Debian system: | ||
Line 200: | Line 200: | ||
</ | </ | ||
- | ===== Step 7: Add user to the docker group ===== | + | === Step 7: Add user to the docker group === |
Add your username to the docker group: | Add your username to the docker group: | ||
Line 208: | Line 208: | ||
</ | </ | ||
- | ===== Step 8: Add docker to user groups | + | === Step 8: Add docker to user groups === |
You can do that by logging out and logging back in or simply by creating a group named docker in your groups list | You can do that by logging out and logging back in or simply by creating a group named docker in your groups list | ||
Line 216: | Line 216: | ||
</ | </ | ||
- | ===== Step 9: Verify Docker Installation | + | === Step 9: Verify Docker Installation === |
Verify that Docker is installed correctly by running a test container: | Verify that Docker is installed correctly by running a test container: | ||
Line 226: | Line 226: | ||
- | ====== | + | ====== Backup Script for Proxmox VM ====== |
Line 238: | Line 238: | ||
===== 2. Running the Backup Script ===== | ===== 2. Running the Backup Script ===== | ||
- | <code> | + | <cli> |
Line 302: | Line 302: | ||
# Print message to the terminal | # Print message to the terminal | ||
echo " | echo " | ||
- | </code> | + | </cli> |
Line 361: | Line 361: | ||
<cli> | <cli> | ||
- | $ docker exec -i odoo15_db | + | $ docker exec -i < |
</ | </ | ||
Line 369: | Line 369: | ||
<cli> | <cli> | ||
- | $ gunzip -c / | + | $ gunzip -c / |
</ | </ | ||
* Replace < | * Replace < | ||
- | Please note that this documentation assumes you are using a Docker container named odoo15_db for the Odoo database. Modify the docker exec command to match your specific Odoo setup. | + | ====== |
+ | - This bash script is designed to automate the process of restoring backups for Odoo in case of data loss or VM issues. The script restores the filestore, extra-addons, | ||
+ | ===== Prerequisites ===== | ||
+ | * Ensure that Docker is installed on the system and the necessary permissions are set to execute Docker commands. | ||
+ | * You should have access to the Odoo PostgreSQL container and the required Odoo directories (filestore and extra-addons). | ||
+ | * Make sure you have the necessary backup files available for the filestore, extra-addons, | ||
+ | ===== Usage ===== | ||
+ | <cli> | ||
+ | #!/bin/bash | ||
+ | # Function to print log messages | ||
+ | log_message() { | ||
+ | echo " | ||
+ | } | ||
+ | # Function to decompress and restore filestore backup | ||
+ | restore_filestore() { | ||
+ | log_message " | ||
+ | sudo mkdir -p " | ||
+ | sudo tar -xzf " | ||
+ | log_message " | ||
+ | } | ||
+ | |||
+ | # Function to decompress and restore extra-addons backup | ||
+ | restore_extra_addons() { | ||
+ | log_message " | ||
+ | sudo tar -xzf " | ||
+ | log_message "Extra Addons Restore completed." | ||
+ | } | ||
+ | |||
+ | # Function to restore the database | ||
+ | restore_database() { | ||
+ | log_message " | ||
+ | docker exec -i " | ||
+ | gunzip -c " | ||
+ | log_message " | ||
+ | } | ||
+ | |||
+ | # Check the number of arguments | ||
+ | if [ $# -ne 5 ]; then | ||
+ | echo " | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | # Assign command-line arguments to variables | ||
+ | DATABASE=$1 | ||
+ | FILESTORE_DIR=$2 | ||
+ | EXTRA_ADDONS_DIR=$3 | ||
+ | POSTGRES_CONT=$4 | ||
+ | BACKUP_DIR=$5 | ||
+ | |||
+ | # Backup filenames | ||
+ | FILESTORE_ARCHIVE=" | ||
+ | DATABASE_ARCHIVE=" | ||
+ | EXTRA_ADDONS_ARCHIVE=" | ||
+ | |||
+ | # Backup date and time | ||
+ | DATETIME=$(date +\%Y-\%m-\%d_\%H-\%M-\%S) | ||
+ | |||
+ | # Start restoring the backups | ||
+ | log_message " | ||
+ | |||
+ | # Step 1: Restore the Filestore | ||
+ | restore_filestore | ||
+ | |||
+ | # Step 2: Restore the Extra Addons | ||
+ | restore_extra_addons | ||
+ | |||
+ | # Step 3: Restore the Database | ||
+ | restore_database | ||
+ | |||
+ | # End restoration | ||
+ | log_message " | ||
+ | |||
+ | # Print message to the terminal | ||
+ | echo " | ||
+ | |||
+ | </ | ||
+ | |||
+ | * Save the script in a file named restore_script.sh. | ||
+ | * Make the script executable with the following command: | ||
+ | <cli> | ||
+ | $ chmod +x restore_script.sh | ||
+ | </ | ||
+ | |||
+ | * Execute the script with the required arguments: | ||
+ | |||
+ | <cli> | ||
+ | $ ./ | ||
+ | </ | ||
+ | |||
+ | * DATABASE: Name of the Odoo database to restore. | ||
+ | * FILESTORE_DIR: | ||
+ | * EXTRA_ADDONS_DIR: | ||
+ | * POSTGRES_CONT: | ||
+ | * BACKUP_DIR: Path to the directory containing the backup files. | ||
+ | |||
+ | ===== Example ===== | ||
+ | |||
+ | <cli> | ||
+ | $ ./ | ||
+ | </ | ||
+ | ===== Restoration Process ===== | ||
+ | * The script performs the following restoration steps: | ||
+ | * Restores the filestore backup to the specified filestore directory. | ||
+ | * Restores the extra-addons backup to the specified extra-addons directory. | ||
+ | * Creates the Odoo database (if it was completely deleted) and restores the database backup. | ||
+ | [[http:// | ||