Maintaining the Odoo service and modules
Once the Odoo server is up and running, it is expected for some maintenance to be needed – for example, installing or updating modules.
These actions involve some risk for the production system, and it is best to test them in a staging environment before applying in production. Let's start with a basic recipe to create a staging environment.
Creating a staging environment
The staging environment should be a copy of the production system and ideally should have its own dedicated server.
A simplification, which is safe enough for most cases, is to have the staging environment in the same server as the production system.
To create a copy of the odoo-prod
production database as the odoo-stage
database, use the following commands:
$ dropdb odoo-stage $ createdb --owner=odoo odoo-stage $ pg_dump odoo-prod | psql -d odoo-stage $ sudo su - odoo $ cd ~/.local/share/Odoo/filestore/ $ cp -r odoo-prod odoo-stage $ exit
Note...