[ADD] doc: Migration docker postgresql

This commit is contained in:
Mathieu Benoit 2021-07-21 04:31:35 -04:00
parent 83ea7ed072
commit 7e5ae534db
3 changed files with 51 additions and 0 deletions

View file

@ -369,6 +369,10 @@ docker_stop:
.PHONY: docker_restart_daemon
docker_restart_daemon: docker_stop docker_run_daemon
.PHONY: docker_show_databases
docker_show_databases:
./script/docker/docker_list_database.sh
.PHONY: docker_show_logs_live
docker_show_logs_live:
docker-compose logs -f

38
doc/MIGRATION.md Normal file
View file

@ -0,0 +1,38 @@
# Migration
Guide to help migration with different version.
## Docker
- Clone project if only download docker-compose
- `git init`
- `git remote add origin https://github.com/erplibre/erplibre`
- `git fetch`
- `mv ./docker-compose.yml /tmp/temp_docker-compose.yml`
- `git checkout master`
- `mv /tmp/temp_docker-compose.yml ./docker-compose.yml`
- Do manually a backup of ERPLibre database (TODO implement makefile command)
- Update `./docker-compose.yml` depending of difference with git.
- Run script `make docker_exec_erplibre_gen_config`
- Stop the docker `make docker_stop`
- Delete the volume, `docker volume rm ${BASENAME}_erplibre-db-data`
- Start the docker `make docker_run_daemon`
- Restore the backup manually.
### Database migration, PostgreSQL update 11 to 12
TODO not working automatically, check last procedure and do it manually. The command to the docker is missing support when database is external.
Easy way, do a backup with ERPLibre, upgrade Postgresql, restore the same backup.
List all database :
```bash
make docker_show_databases
```
## Vanilla
- Run script `make install_dev`
- Restart your daemon
- Regenerate master password manually

View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
CURRENT=$(pwd)
BASENAME=$(basename "${CURRENT}")
docker exec -u root -ti ${BASENAME}_ERPLibre_1 /bin/bash -c "\
cd /ERPLibre; \
time make db_list; \
"