This script is used to make the staging database tables a clone of the production database tables. A few modifications are made to the dumps before loading so that the staging database works (e.g. users are renamed, ownership changed).
The script roughly follows these steps:
- Dump the production database tables.
- Modify the dump to rename users and change ownership.
- Load the modified dump into the staging database tables.
The script needs to be run on a server with access to the database (e.g. a bastion host on AWS).
Passwords for the following users need to be set in the environment variables:
prod_loculus_userstaging_loculus_userprod_keycloak_userstaging_keycloak_userpostgres
Run the script as follows:
./clone-prod-to-staging.shIt can happen that part of the clone fails. You can check the logs if things don't work as expected.