Database backup strategy and disaster recovery
You derive a backup plan for different engines from recovery targets, automate and encrypt backups, keep remote copies and prove disaster recovery through drills.
Level 301 · 16 lessons · 15 practice labs
Lessons
The plan
- RPO and RTO: how much data, how much time
- A backup inventory: which data lives where
- Backup methods by engine
- Retention schemes: grandfather-father-son
- Short task: write a backup plan for a company
Automation
- Backup scripts and error checking
- Scheduling: cron and systemd timers
- Encrypting backups
- Copies to remote servers and object storage
- Immutable copies and ransomware
- Short task: automate nightly backups for four engines
Recovery
- Restore runbooks
- Verifying restored data
- A disaster recovery drill
- Reporting backup status
- Capstone: the server room burned down, bring everything back
Practice labs
- Put acceptable data loss into numbers: Derive RPO and RTO values for four systems at Mavikuş Cargo from interview notes with business units.
- Map data to backups: Scan the servers for every database, find which ones are not backed up and record them in an inventory table.
- Design a grandfather-father-son retention plan: Prepare and apply a plan with retention periods for daily, weekly and monthly copies and the storage cost they bring.
- Add error checks to a backup script: Fix a backup script that says "success" even on failure so it checks exit codes and file size.
- Schedule nightly backups with a systemd timer: Move from cron to a systemd timer, make it catch up missed runs and follow the logs with journalctl.
- One backup routine for four engines: Write one script that backs up MySQL, PostgreSQL, MongoDB and Redis with common naming and a report.
- Encrypt a backup file: Encrypt a backup file with a public key and show only the private key can open it.
- Copy backups to remote storage: Add a step that uploads backups to object storage and checks integrity with checksums.
- Keep a ransomware-proof copy: Copy to a store with an immutable mode, try deleting as if the server were compromised and prove the copy survives.
- Follow a restore runbook step by step: Follow a ready restore runbook to load the database onto a test server and note missing steps.
- Verify restored data: Check a restored database for gaps using row counts, checksums and latest record dates.
- Find why a backup won't restore: Find why months of untested backups fail to restore and set up a regular verification job.
- Prepare a backup status report: Write a report script that shows each backup's time, size and verification result in one table.
- Run a recovery drill for one database: Start a timer, recover a database from scratch and compare the measured time with the RTO target.
- The server room burned down; bring it all back: Rebuild four engines on new servers from remote copies only and report the real RPO and RTO.
About this course
You derive a backup plan for different engines from recovery targets, automate and encrypt backups, keep remote copies and prove disaster recovery through drills.
What you will learn
- The plan
- Automation
- Recovery
Prerequisites
You should be comfortable with the level 101 and 201 topics of the same path.
Lab environment
Lessons run in your own Kali Linux terminal in the browser, connected to a private lab network. Nothing to install.
Frequently asked questions
- Is this course right for my level?
- The course is at level 301; it assumes you know the topics of the lower-level courses.
- Is there anything to install?
- No. Every lesson runs in your own lab environment that opens in the browser.
- How do lessons work?
- Each lesson has 8 to 10 steps and a short quiz. Early steps show the command to type, later steps give less help; if two attempts fail, the solution opens.
- Can I try it for free?
- Yes. The first three lessons of every course are free.