Closed tpendragon closed 1 year ago
Note: I did this one already in staging, because I used it to test the commands above.
This will result in ~ 10 minutes of down time, just do it whenever.
to validate: enter a dbconsole
> bundle exec rails dbconsole -p
=> select version();
done
Update CI to use postgres 15
Staging:
ansible lae_staging -a "sudo service nginx stop && sudo service lae-sneakers stop" -u pulsys
ansible lib-postgres-staging1.princeton.edu -e @group_vars/all/vault.yml -m shell -a "export PGPASSWORD=\"{{vault_postgres_staging_admin_password}}\"; pg_dump -h lib-postgres-staging3 --format custom --clean lae_staging -U postgres > /tmp/lae_staging.dump" -u pulsys
ansible-playbook playbooks/lae.yml --tags postgresql
ansible lib-postgres-staging1.princeton.edu -e @group_vars/all/vault.yml -m shell -a "export PGPASSWORD=\"{{vault_postgres_staging_admin_password}}\"; pg_restore -h 127.0.0.1 -U postgres --dbname lae_staging /tmp/lae_staging.dump" -u pulsys
ansible-playbook playbooks/lae.yml --tags site_config
)Production:
ansible lae_production -a "sudo service nginx stop && sudo service lae-sneakers stop" -u pulsys
ansible lib-postgres-prod1.princeton.edu -e @group_vars/all/vault.yml -m shell -a "export PGPASSWORD=\"{{vault_postgres_admin_password}}\"; pg_dump -h lib-postgres-prod3 --format custom --clean lae_production -U postgres > /tmp/lae_prod.dump" -u pulsys
ansible-playbook playbooks/lae.yml --tags postgresql -e runtime_env=production
ansible lib-postgres-prod1.princeton.edu -e @group_vars/all/vault.yml -m shell -a "export PGPASSWORD=\"{{vault_postgres_admin_password}}\"; pg_restore -h 127.0.0.1 -U postgres --dbname lae_production /tmp/lae_prod.dump" -u pulsys
ansible-playbook playbooks/lae.yml --tags site_config -e runtime_env=production
)