Drupal - Periodic Maintenance

Quarterly Tasks

DB Purge - Acquia Database Backups

Each time a deploy is performed in production, a backup is taken and saved on the Acquia environment so we can roll back if needed. Periodically we need to purge and archive these backups to conserve space on Acquia.

Follow these steps to purge older backups which are not needed.

  1. SSH onto the Acquia Prod environment

  2. go to backups folder

    cd /mnt/gfs/bostond8/backups/on-demand
  3. list the backups.

    ls -la
  4. We should keep all on-demand backups for 3 months, after that we only need to retain the first backup in any month. Delete backups which are older than 3 months and which are not the first backup in a month. For example, in June 2022 you could use the command below to clean up backups from january 2022 - when prompted, enter "n" for the first backup in January and "y" for all subsequent backups.

    rm -fi /mnt/gfs/bostond8/backups/on-demand/backup-2022-01* 

Annual Tasks

1. Archive Acquia Production Database Backups

Each time a deploy is performed in production, a backup is taken and saved on the Acquia environment so we can roll back if needed. Periodically we need to purge and archive these backups to conserve space on Acquia.

Ensure the Quarterly DB Purge task has been performed before starting this task.

Follow these steps to archive production database backups off Acquia and onto AWS.

This is the Archive (a folder in an S3 bucket).

  1. SSH onto the Acquia Prod environment.

  2. Go to the Acquia on-demand backups folder:

    cd /mnt/gfs/bostond8/backups/on-demand
  3. List the backups, check and note which backups are more that 12 months old (if the quarterly purge DB task has been regularly completed, there should only be one backup per month):

    ls -la
  4. On your local machine rsync to copy down backups. For example to copy all backups from 2022:

    rsync -arz -essh -P "bostond8.prod@bostond8.ssh.prod.acquia-sites.com:/mnt/gfs/bostond8/backups/on-demand/backup-2022*" ~/dumps/
  5. from local machine (in example above ~/dumps) copy up to the S3 bucket, cob-digital-archives/drupal/

  6. SSH onto the Acquia Prod environment and delete the files which have been archived. Continuing the example from above (use -i to be safe):

    rm -fi /mnt/gfs/bostond8/backups/on-demand/backup-2022* 

Last updated