Skip to Content

Installation Guide

Installing Python Packages with pip

Python packages can be easily installed using pip, the package installer for Python. Follow the steps below to install packages using pip:

  1. Open your command-line interface (e.g., Terminal, Command Prompt).
  2. Check if pip is installed by running the following command: bash
#!/bin/bash
$ pip --version

If pip is not installed, you can install it by following the official documentation at https://pip.pypa.io/en/stable/installing/.

To install a package, use the following command:

$ pip install package\_name

Replace package_name with the name of the package you want to install.

Example: To install the pysftp, dropbox, tqdm, simplejson package, run:

$ pip install pysftp dropbox tqdm simplejson

You can install multiple packages by listing them with spaces:

$ pip install package1 package2 package3

To install a specific version of a package, use the following command:

$ pip install package\_name==version\_number

Replace version_number with the desired version of the package.

Example: To install version 2.2.0 of the pysftp package, run:

$ pip install pysftp==2.2.0
  1. If you don’t specify a version, pip will install the latest version available.


Installing Packages within a Virtual Environment

Using a virtual environment is a recommended practice to manage Python packages for specific projects. Follow the steps below to install packages within a virtual environment:

  1. Create a new virtual environment by running the following command:
$ python -m venv env\_name

Replace env_name with the desired name for your virtual environment.

Activate the virtual environment:

  • On Windows:
$ .\env\_name\Scripts\activate

On macOS and Linux:

$ source env_name/bin/activate

Once the virtual environment is activated, use pip to install packages as described in the previous section. The packages will be installed within the virtual environment and won't interfere with other Python installations.

To deactivate the virtual environment, simply run the following command:

$ deactivate
  1. This will return you to your regular command-line environment.

Using virtual environments helps maintain clean and isolated environments for different projects, ensuring package dependencies are managed effectively.

Install Automatic Odoo Backup Module In Odoo ERP

Open Odoo Apps page in Odoo ERP

Automatic Odoo Backup

Upon restarting your Odoo server, proceed to access the Odoo apps page within your Odoo ERP instance. Utilize the "Update Apps List" menu to synchronize and retrieve the most recent modules from the addons path. Subsequently, identify the automatic backup module for installation.

Automatic Backup Module in Odoo ERP

The module is prepared for installation. Please proceed by clicking on the install button.

Setup Backup Configurations

General Settings -> Backup -> Configurations

Configure Database Settings


  1. The database role is determined by the value of the db_user parameter in your Odoo configuration file.
  2. The password is determined by the value of the db_password parameter in your Odoo configuration file.

If the db_password is not configured for your Odoo role, you can establish it through the psql terminal using the following command:

ALTER ROLE <your Odoo role name> PASSWORD '<desired password>'

Example Odoo Configuration File:
admin_passwd = mysupersecretpassword
db_host = 192.168.1.2
db_port = 5432
db_user = odoo
db_password = pwd
dbfilter = ^mycompany.*$

Backup Formats

The output format can be one of the following:

  1. plain: Output a plain-text SQL script file (the default). This format is useful for very small databases with a minimal number of objects, but it should generally be avoided for larger databases.
  2. custom: Output a custom archive suitable for input into pg_restore. This is the most flexible format, as it allows for the reordering and definition of objects when restoring the database. It is also compressed by default, using gzip (ie, test.gz). We recommend using this format, as it allows you to restore single objects from a backup.
  3. tar: Output a tar archive suitable for input into pg_restore. This archive format allows for the reordering and exclusion of database objects during restoration, as well as the ability to limit which data is reloaded. It is used with gzip compression.
  4. Dump With Filestore: Output a backup zipped with the filestore. This option is not recommended for larger databases, as it can be difficult to restore from this view.

Backup Modes

  1. Local Server / Drives
  2. Remote Server / Remote Paths
  3. Google Drive
  4. Dropbox
  5. Amazon S3

Local Backups

Backups to local drives or folder paths




Remote Backups

Backups to remote drives or remote folder paths




Google Drive

Backups to google drive


To Configure Google Drive Client Key & Secret Key:

To get started with the Google Drive API, you will need to: Set up a Google Cloud Platform project and enable the Drive API for your project.

To set up a Google Cloud Platform (GCP) project and enable the Drive API, follow these steps:

  • Go to the Google API Console (https://console.developers.google.com/).
  • If you don't already have a project, click the "Create Project" button. If you have an existing project, select it from the project drop-down menu.
  • Once you have a project, click the "Enable APIs and Services" button.
  • In the search box, type "Google Drive API" and press enter. Click on the "Google Drive API" result that appears. Click the "Enable" button to enable the Google Drive API for your project.
  • Once the API is enabled, click the "Create Credentials" button. On the "Add credentials to your project" page, select the "OAuth 2.0 client ID" option.
  • Select the appropriate application type (e.g. "Web application"), add proper details in the form and make sure to add the redirect uri as https://yourdomain.com/drive/authentication and click the "Create" button.
  • On the "Create client ID" page, you will be prompted to configure the consent screen. Fill in the necessary information and click the "Save" button.
  • After the consent screen is configured, you will be presented with your client ID and client secret. You will need these credentials to authenticate your API requests.

The client ID is a unique identifier that is generated when you create a new OAuth 2.0 client in the Google API Console. It is used to identify your application when you request access to a user's Google account. To find your client ID & Secret Key:

  • Go to the Google API Console (https://console.developers.google.com/).
  • Select the project that you want to use with the Google Drive API.
  • Click the "Credentials" tab on the left-hand side of the page.
  • Your client ID will be listed under the "OAuth 2.0 client IDs" section.

To Configure Backup Directories:

Google Drive: The IDs of the parent folders which contain the file. If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests must use the addParents and removeParents parameters to modify the parents list. Eg: https://drive.google.com/drive/u/0/folders/1vzEwZyIBBthjvgKK97OYiByWAI1u6k4


Dropbox

Backups to dropbox folders


To Configure Backup Directories:

Dropbox: Path inside your app folder in dropbox. If you specify a path and not available, then system will create a location. Eg: folder ODOO -> Backups -> DB = /ODOO/Backups/DB


Amazon S3

Backups to S3 Buckets



Amazon S3 Storage:

You can create the credential file yourself. By default, its location is at ~/.aws/credentials

File content should be:

[default]
aws_access_key_id = YOUR_ACCESS_KEY
aws_secret_access_key = YOUR_SECRET_KEY

Or, you need to fill AWS access key and secret key in the Amazon S3 Key, secret key section in this form.


Automatically Remove Backups



Deactivate



Establish Backup Routine

  1. Enable Developer Mode
  2. Navigate to General Settings -> Technical -> Scheduled Actions, locate "Dump Current Odoo DB"
  3. Setup the desired intervals (Example: 2 Weeks, 5 Hours, or One Month)
  4. You can duplicate the scheduled actions and can have multiple intervals also, only change the "Execute Every Days/Hours/Weeks/Months"


Video Tutorials

Setup Libraries / Install python packages


Setup Odoo Automated Backup Configurations


Download Module From Odoo Apps Store

Download Odoo Automated Backup Module