The Reset environment Github Action can be used to clear a development, qa and staging environment of all data. This is useful during testing of environments where you may have made test registrations.
After resetting your environment, it contains no data at all. It must be seeded again,
Perhaps you need to clear production after completing a test that backup is working successfully in readiness for going live. Or perhaps you need to restore a previous backup onto production for some other reason. In these scenarios, you would be required to reset your production environment.
To protect you from accidentally resetting a production environment, we do not provide an action for this. As part of our Pre-Deployment Checklist, perhaps you have made test registrations on production and are required to clear it before going live. The following explains the steps required. These are the manual steps that the Reset Environment action performs in an automated way.
You need the REPLICAS, ELASTICSEARCH_ADMIN_PASSWORD, MONGODB_ADMIN_USER, MONGODB_ADMIN_PASSWORD, MINIO_ROOT_USER and MINIO_ROOT_PASSWORD secrets for the production environment. You created and stored these in your password manager in this step.
SSH into your production environment manager node and run this command on your server to set these environment variables in your terminal session.
Run the following command to clear the data:
All the databases are now empty but some database migrations must run to prepare them for re-seeding or restoring a backup. Run this command to migrate the databases:
Run this command to clear your terminal session of the history of any exported secrets (security step)
Your production environment is now ready for re-seeding / restoration.