Fundraising/techops/procedures/services-civicrm staging db refresh
Appearance
<
Fundraising
|
techops
Every quarter or so, we will want to refresh the staging databases. To do so we use the following steps:
-
Pull the latest database backups for the civicrm, drupal, and fredge databases from frlog1002 to the current frdb_staging host placing them in the
/srv/db_restoredirectory.-
Example:
$ cd /srv/archive/database_dumps $ scp civicrm.20251008-090004.frdb1004.sql.gz fredge.20251008-153445.frdb1004.sql.gz backupmover@frdb1006:/srv/db_restore
-
Example:
-
Then on the staging db server:
cd /srv/db_restore -
Run
/usr/local/bin/staging_db_refreshin a screen session answering the prompts. - Monitor the output of the log file. It will take approximately 3 days to complete the selective restore as of 2023-11-16.
Along with this, we need to refresh the angular files from backup using the following steps.
- Ensure you have access to a proper GPG key to decrypt the backup.
-
Pull the latest backup from the logger host in
/srv/archive/civi/backups/-
Example:
$ cd /srv/archive/civi/backups $ rsync -avh -e ssh civi1002-20251008.010001.tar.bz2.gpg backupmover@frdev1002:/srv/db_restore
-
Example:
-
On the staging server, extract the
/srv/org.wikimedia.civicrm-files/civicrm/angdirectory from the tarball to the proper location on the staging server.-
Example:
$ cd / $ gpg --decrypt /srv/db_restore/civi1002-20251008.010001.tar.bz2.gpg | tar -jxv srv/org.wikimedia.civicrm-files/civicrm/ang
-
Example: