Updating the idGenerator database
We sometimes have to update the idGenerator database (because of a change in the environment, or to update the version of the server). The upgrade process consists in deploying a new instance of the database and migrating the IDs from the old instance to the new instance.
Deploying a new instance of the idGenerator database
In the StackBuilder repository, update the id of the IdGeneratorDB
see https://github.com/Sage-Bionetworks/Synapse-Stack-Builder/pull/691/files
Update on Develop stack
Deploy new database with http://build-system-ops.dev.sagebase.org:8080/job/build-dev-idgen/
Typically, the swap itself is done with the stack in RO mode after final migration, for the dev stack you can put the stack in RO mode when needed.
Generate the update script with http://build-system-ops.dev.sagebase.org:8080/job/generate_ids
Cleanup the script ('\\n'=>'\n') to make it runnable
Connect to the new database and execute the script
Change the DNS dev-id-generator-db.dev.sagebase.org to point dev-id-generator-db-<n+1>-orange.dev.sagebase.org (created by StackBuilder) in R53 console
Restart the app servers in Beanstalk
Bind NLBs to ALBs with http://build-system-ops.dev.sagebase.org:8080/job/dev-link-dns-to-alb/
Go live by changing the RO status in the repo DB
Update on Production stack
Deploy new database with http://build-system-ops.prod.sagebase.org:8080/job/build-synapse-prod-id-generator/
Typically, the swap itself is done with the stack in RO mode after final migration (both the source and destination stacks should be in RO mode).
Generate the update script with http://build-system-ops.prod.sagebase.org:8080/job/generate_ids/
Cleanup the script ('\n' etc.) to make it runnable
Connect to the new database and execute the script (typically with second pair of eyes)
Change the DNS prod-id-generator-db.prod.sagebase.org to point prod-id-generator-db-<n+1>-orange.prod.sagebase.org (created by StackBuilder)
Restart the app servers in Beanstalk
Bind NLBs to ALBs with http://build-system-ops.prod.sagebase.org:8080/job/build-synapse-prod-bind-nlb-to-alb/ in Route53 console
Go live by changing the status in the repo DB