Migrate to PostgreSQL #93515

Closed
opened 2021-11-30 15:34:43 +01:00 by Anna Sirota · 4 comments
Owner

Same as infrastructure/blender-id#93212 ([Chore] Migrate to PostgreSQL), but pgloader must be run from inside DevFund's container.

Recap of the migration

copy latest pgloader files to make them available in the container

  rsync -r /opt/pgloader /var/www/blender-fund/settings
  

switch to maintenance

- ! make sure that latest production is deployed and SUPPORTS PSQL
- ! add maintenance mode to Apache config

# show a maintenance page
  docker exec -it blender-fund bash
  apachectl configtest   # apachectl -t
  apachectl -k graceful
  touch /var/www/html/maintenance_on
# stop cron
  sudo systemctl stop cron

backup everything

  sudo /bin/bash /var/www/blender-fund/backup.sh
  sudo -Hu dbbackup /var/www/sintel-blender-org-management/postgresql_backup.sh

copy and switch

#! copy the data
  docker exec -it blender-fund bash
  cd /var/www/settings/pgloader/
  bash copy_mysql_fund_to_psql.sh 2>&1 | tee /var/log/pgloader001_fund.log
#! change default database
  vim /var/www/blender-fund/settings/blender_fund_settings.py

bring everything back

#! hide a maintenance page
  docker exec -it blender-fund bash
  apachectl configtest
  rm /var/www/html/maintenance_on
#! start cron
  sudo systemctl start cron
Same as infrastructure/blender-id#93212 ([Chore] Migrate to PostgreSQL), but `pgloader` must be run from inside DevFund's container. ### Recap of the migration **copy latest pgloader files to make them available in the container** ``` rsync -r /opt/pgloader /var/www/blender-fund/settings ``` **switch to maintenance** - ! make sure that latest production is deployed and SUPPORTS PSQL - ! add maintenance mode to Apache config # show a maintenance page ``` docker exec -it blender-fund bash apachectl configtest # apachectl -t apachectl -k graceful touch /var/www/html/maintenance_on ``` # stop cron ``` sudo systemctl stop cron ``` **backup everything** ``` sudo /bin/bash /var/www/blender-fund/backup.sh sudo -Hu dbbackup /var/www/sintel-blender-org-management/postgresql_backup.sh ``` **copy and switch** #! copy the data ``` docker exec -it blender-fund bash cd /var/www/settings/pgloader/ bash copy_mysql_fund_to_psql.sh 2>&1 | tee /var/log/pgloader001_fund.log ``` #! change default database ``` vim /var/www/blender-fund/settings/blender_fund_settings.py ``` **bring everything back** #! hide a maintenance page ``` docker exec -it blender-fund bash apachectl configtest rm /var/www/html/maintenance_on ``` #! start cron ``` sudo systemctl start cron
Anna Sirota self-assigned this 2021-11-30 15:34:43 +01:00
Author
Owner

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Owner

Added subscriber: @railla

Added subscriber: @railla

Added subscriber: @GeorgiaPacific

Added subscriber: @GeorgiaPacific
Author
Owner

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: infrastructure/devfund-website#93515
No description provided.