diff --git a/doc/PRODUCTION.md b/doc/PRODUCTION.md index 976658c..c5971a3 100644 --- a/doc/PRODUCTION.md +++ b/doc/PRODUCTION.md @@ -62,9 +62,10 @@ cd /[EL_USER]/erplibre ## Move prod database to dev When moving prod database to your dev environment, you want to remove email servers and install user test to test the database. +Warning, this is not safe for production, you expose all data. Run: ```bash -./run.sh --stop-after-init -i user_test,disable_mail_server --dev all -d DATABASE +./script/migrate_prod_to_test.sh DATABASE ``` ## Update production diff --git a/script/migrate_prod_to_test.sh b/script/migrate_prod_to_test.sh new file mode 100755 index 0000000..21c1f63 --- /dev/null +++ b/script/migrate_prod_to_test.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +if [ $# -lt 1 ]; then + # TODO: print usage + echo "Missing database name" + exit 1 +fi +source ./.venv/bin/activate +python3 ./odoo/odoo-bin -c ./config.conf --limit-time-real 99999 --limit-time-cpu 99999 --stop-after-init -i user_test,disable_mail_server,disable_auto_backup --dev all -d $@