Jump to content

This is a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Fundraising/techops/procedures/services-civicrm staging db refresh

From Wikitech

Every quarter or so, we will want to refresh the staging databases. To do so we use the following steps:

  1. 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_restore directory.
    • Example:
      $ cd /srv/archive/database_dumps
      $ scp civicrm.20251008-090004.frdb1004.sql.gz fredge.20251008-153445.frdb1004.sql.gz backupmover@frdb1006:/srv/db_restore
      
  2. Then on the staging db server: cd /srv/db_restore
  3. Run /usr/local/bin/staging_db_refresh in a screen session answering the prompts.
  4. 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.

  1. Ensure you have access to a proper GPG key to decrypt the backup.
  2. 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
      
  3. On the staging server, extract the /srv/org.wikimedia.civicrm-files/civicrm/ang directory 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