-
Notifications
You must be signed in to change notification settings - Fork 25
Database Recovery Plan
You can restore a DB instance to a specific point in time, creating a new DB instance. When you restore a DB instance to a point in time, the default DB security group is applied to the new DB instance. If you need custom DB security groups applied to your DB instance, you must apply them explicitly.
RDS uploads transaction logs for DB instances to Amazon S3 every 5 minutes. To determine the latest restorable time for a DB instance, use the AWS CLI describe-db-instances command and look at the value returned in the LatestRestorableTime field for the DB instance.
aws rds describe-db-instances
-
Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.
-
In the navigation pane, choose Databases.
-
Choose the DB instance that you want to restore.
-
For Actions, choose Restore to point in time. The Launch DB Instance window appears.
-
Choose Latest restorable time to restore to the latest possible time, or choose Custom to choose a time.
If you chose Custom, enter the date and time that you want to restore the instance to.
Note Times are shown in your local time zone, which is indicated by an offset from Coordinated Universal Time (UTC). For example, UTC-5 is Eastern Standard Time/Central Daylight Time.
-
For DB instance identifier, enter the name of the target restored DB instance.
-
Choose other options as needed.
-
Choose Launch DB Instance.
To restore a DB instance to a specified time, use the AWS CLI command restore-db-instance-to-point-in-time to create a new DB instance.
For Linux, macOS, or Unix:
aws rds restore-db-instance-to-point-in-time \
--source-db-instance-identifier mysourcedbinstance \
--target-db-instance-identifier mytargetdbinstance \
--restore-time 2017-10-14T23:45:00.000Z
For Windows:
aws rds restore-db-instance-to-point-in-time ^
--source-db-instance-identifier mysourcedbinstance ^
--target-db-instance-identifier mytargetdbinstance ^
--restore-time 2017-10-14T23:45:00.000Z
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIT.html
Automated backups: Enabled (7 Days) Copy tags to snapshots: Enabled VPC security groups: HiC-database-sg (sg-02161621997e5ad37), eAPD Production RDS (sg-0e8ec17f26d3bb4c9)
Automated backups: Enabled (7 Days) Copy tags to snapshots: Disabled VPC security groups: eAPD Staging RDS (sg-0a6b8b834c21c0995)
Start: 10:00 am DB Created: 10:20 am Update & Run CircleCI Ended: 10:40 am Put everything back in place: 10:40 am End: 11:08 am
- Log into AWS Console
- Navigate to RDS >> Databases
- Select the Database to be restored from Snapshot
- From the “Actions” dropdown select “Restore to point in time”
- Select “Latest restorable time” or use the “Custom” option to select the last known good database restore point
Leave the default values unless otherwise specified
-
“DB instance identifier” must be different from the name of the database you are restoring. I suggest something like: staging-eapd-cms-gov-20201008 (year/month/day)
-
“Availability & durability” staging does not require any changes here, production will you to click the “Create a standby instance” radial
-
Lastly click “Launch DB Instance”
-
Log Into CircleCI
-
Take note of the endpoint URL (in the AWS console) of the new database (once it populates towards the end of creation) 10a. This can be found by going back to the “Databases” section 10b. Clicking on the database 10c. Finding the “Endpoint” section in the “Connectivity & Security” tab
-
Replace the existing URL section of the STAGING_API_DATABASE_URL variable with the new endpoint URL (ex postgres://username:password@newendpointurl/database) in the CircleCI “Environment Variables”
-
Rerun the last CircleCI deploy to staging/production (depending on the database you are restoring)
-
Once the job completes STOP the original database
-
Once the database has stopped, check the site by logging in
-
Once logged in terminate the replaced database
-
Update the environment variables in Keybase
- Team Working Agreement
- Team composition
- Workflows and processes
- Testing and bug filing
- Accessing eAPD
- Active Documentation:
- Sandbox Environment
- Glossary of acronyms
- APDs 101
- Design iterations archive
- MMIS Budget calculations
- HITECH Budget calculations
- Beyond the APD: From Paper to Pixels
- UX principles
- User research process
- Visual styling
- Content guide
- User research findings
- eAPD pilot findings
- User needs
- Developer info
- Development environment
- Coding Standards
- Development deployment
- Infrastructure Architecture
- Code Architecture
- Tech 101
- Authentication
- APD Auto Saving Process
- Resetting an Environment
- Hardware Software List
- Deploying Staging Production Instances Using Scripts
- Terraform 101 for eAPD
- Provisioning Infrastructure with Terraform
- WebSocket basics
- Operations-and-Support-Index
- Single Branch Deployment Strategy
- Ops and Support Overview
- Service Level AOI
- Incident Response Plan
- On-Call Policy
- Infrastructure Contingency Plan
- Updating CloudFront Security Headers
- Requesting and Installing TLS Certificates