From 58727c48381dcae99b50c0610336ee8772d72cdf Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Fri, 4 Feb 2022 14:12:53 -0500 Subject: [PATCH] [ADD] makefile: db_restore_prod_client to restore database production local --- Makefile | 11 +++++++++++ doc/DEVELOPMENT.md | 9 ++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 385e695..21de8fb 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,11 @@ run_test: echo http://localhost:8069 ./run.sh --database test +.PHONY: run_prod_client +run_prod_client: + echo http://localhost:8069 + ./run.sh --database prod_client + .PHONY: run_code_generator run_code_generator: echo http://localhost:8069 @@ -134,6 +139,12 @@ db_restore_erplibre_base_db_test_module_test: ./script/db_restore.py --database test ./script/addons/install_addons.sh test test +.PHONY: db_restore_prod_client +db_restore_prod_client: + # You need to put the database backup in ./image_db/prod_client.zip + ./script/db_restore.py --database prod_client --image prod_client + ./script/migrate_prod_to_test.sh prod_client + .PHONY: db_restore_erplibre_base_db_test_image_test db_restore_erplibre_base_db_test_image_test: ./script/db_restore.py --database test --image test diff --git a/doc/DEVELOPMENT.md b/doc/DEVELOPMENT.md index 6fdb92f..ede953d 100644 --- a/doc/DEVELOPMENT.md +++ b/doc/DEVELOPMENT.md @@ -61,11 +61,14 @@ Execute to generate Repo manifest ## Move database from prod to dev -When moving database from prod to your dev environment, you want to remove email servers and install user test in order -to test the database. Run: +Copy the database image into `./image_db/prod_client.zip` and run `make db_restore_prod_client`. This will create a database +named `prod_client` ready to test. + +When moving database from prod to your dev environment, you want to remove email servers, backups and install user test +in order to test the database. Run: ```bash -./run.sh --stop-after-init -i user_test,disable_mail_server --dev all -d DATABASE +./script/migrate_prod_to_test.sh DATABASE ``` ## Change git url https to Git