-
Notifications
You must be signed in to change notification settings - Fork 3
Database Patches
-
Beginning with the v4.0 release of this Docker, database patches should automatically be run on startup; however, if something goes wrong, the following commands can help. In the
docker-compose.yml, make sure to setRUN_DB_PATCHES=TRUEand provide the database parameters, as is done in the provideddocker-compose.yml. -
Database patch changes require you to run the database patch onto your database. Database patches can take long to complete, and so you should run them in a screen session. To do this, enter a screen session, then login to the running web docker using
docker exec -it breedbase_web bash, then change directory to where the new database patch lives (e.g.cd /home/production/cxgn/sgn/db/00129), and finally run the patch onto your database usingmx-run NameOfPatch -H breedbase_db -D empty_fixture -u janedoe. Notice, that the mx-run command uses NameOfPatch and not NameOfPatch.pm. -
If you are updating across several versions (e.g. v1.3 to 1.7) and there are many database patches to run, you can use the
run_all_patches.pl. Database patches can take long to complete, and so you should run them in a screen session. To do this, enter a screen session, then login to the running web docker usingdocker exec -it breedbase_web bash, then change directories to/home/production/cxgn/sgn/db, and finally runperl run_all_patches.pl -h breedbase_db -d empty_fixture -u postgres -p postgres -e janedoe. -
When updating between major versions (e.g. v1 to v2) it is recommended to create database backups. Backup your database first by logging into where the database is running (e.g.
docker exec -it breedbase_db bash) then create a backup to a file usingpg_dump -U postgres empty_fixture > breedbase_fixture_v1_10122020.sql. Keep this backup safe!
Please support me if you find this open-source software useful!
Please cite ImageBreed if you find this system useful.