Pertemuan 4: Backup dan Restore Data

1. Pendahuluan

Backup data adalah salah satu tugas paling kritis dalam administrasi sistem. Kehilangan data dapat menyebabkan kerugian finansial, operasional, dan reputasi yang signifikan.

Critical Task: Pada pertemuan ini, kita akan mempelajari strategi, tools, dan praktik terbaik untuk memastikan data dapat dipulihkan dengan cepat dan akurat ketika terjadi insiden.
Hardware Failure
Disk crash, RAID failure
Human Error
Accidental deletion
Malware Attack
Ransomware, virus
Natural Disaster
Fire, flood, earthquake

2. Mengapa Backup Sangat Penting?

Ancaman terhadap Data
  • Kegagalan hardware - Disk crash, RAID failure
  • Human error - Accidental deletion, wrong configuration
  • Malware dan ransomware - Encryption attacks
  • Bencana alam - Kebakaran, banjir, gempa
  • Sabotase internal - Disgruntled employees
Konsekuensi tanpa Backup
  • Downtime operasional yang berkepanjangan
  • Kehilangan data permanent - No recovery
  • Pelanggaran compliance dan regulasi
  • Kerugian finansial dan reputasi
  • Business closure - Untuk bisnis kecil
Statistik: Menurut studi, 60% bisnis yang kehilangan data akan tutup dalam 6 bulan. Ransomware attacks meningkat 150% setiap tahunnya.

3. Strategi Backup: Jenis-jenis Backup

Full Backup

Menyalin semua data yang dipilih

Kelebihan Restore cepat dan sederhana Complete data protection
Kekurangan Membutuhkan storage besar Waktu backup lama
Waktu: 4-8 jam
Storage: 100%
Incremental Backup

Hanya backup data yang berubah sejak backup terakhir

Kelebihan Cepat dan hemat storage Efisien bandwidth
Kekurangan Restore kompleks Perlu chain backup lengkap
Waktu: 15-30 menit
Storage: 5-10%
Differential Backup

Backup data yang berubah sejak full backup terakhir

Kelebihan Restore lebih sederhana Balance speed & simplicity
Kekurangan Storage lebih besar Waktu backup meningkat
Waktu: 1-2 jam
Storage: 20-40%
Contoh Siklus Backup 7 Hari:
Hari Jenis Backup Data yang Dibackup Waktu Est. Storage Used
Senin Full Backup Semua data (100GB) 4 jam 100GB
Selasa Incremental Perubahan sejak Senin (2GB) 15 menit 2GB
Rabu Incremental Perubahan sejak Selasa (1.5GB) 12 menit 1.5GB
Kamis Incremental Perubahan sejak Rabu (3GB) 20 menit 3GB
Jumat Incremental Perubahan sejak Kamis (2GB) 15 menit 2GB
Sabtu Incremental Perubahan sejak Jumat (1GB) 10 menit 1GB
Minggu Incremental Perubahan sejak Sabtu (0.5GB) 8 menit 0.5GB
Total Mingguan 109GB

4. Strategi Retention dan RTO/RPO

RTO (Recovery Time Objective)

4 jam

Waktu maksimal yang dapat diterima untuk memulihkan sistem

Contoh: RTO 4 jam → sistem harus berjalan dalam 4 jam setelah insiden
Time to Recovery
RPO (Recovery Point Objective)

1 jam

Maximum acceptable data loss (dalam waktu)

Contoh: RPO 1 jam → maksimal kehilangan data 1 jam terakhir
Data Loss Window
Retention Policy Examples:
Daily Backups

Disimpan: 30 hari

Contoh: Backup harian dari 1-30 hari terakhir

Weekly Backups

Disimpan: 12 minggu

Contoh: Backup mingguan 3 bulan terakhir

Monthly Backups

Disimpan: 12 bulan

Contoh: Backup bulanan 1 tahun terakhir

5. Tools Backup di Linux

tar (Tape Archive)

Traditional Unix tool untuk archiving

Backup Command:
# Backup dengan timestamp
tar -czpf /backup/home_backup_$(date +%Y%m%d).tar.gz /home/
Restore Command:
# Extract backup
tar -xzpf /backup/home_backup_20241015.tar.gz -C /
Options:
  • -c Create archive
  • -z Compress dengan gzip
  • -p Preserve permissions
  • -f File output
rsync (Remote Sync)

Efficient file synchronization tool

Local Sync:
# Synchronize directories
rsync -av --delete /source/ /backup/destination/
Remote Sync:
# Sync ke remote server
rsync -avz -e ssh /local/data/ user@remote-server:/backup/data/
Options:
  • -a Archive mode
  • -v Verbose output
  • -z Compression
  • --delete Delete extra files
dd (Disk Duplicate)

Low-level disk copying tool

Backup Entire Disk:
# Backup entire disk to image
dd if=/dev/sda of=/backup/sda_backup.img bs=4M status=progress
Restore Disk:
# Restore disk from image
dd if=/backup/sda_backup.img of=/dev/sda bs=4M status=progress
Options:
  • if Input file
  • of Output file
  • bs Block size
  • status=progress Show progress
Enterprise Solutions

Enterprise-grade backup solutions

Amanda:
# Advanced Maryland Automatic Network Disk Archiver
amdump daily
Bacula/Bareos:
# Network backup solution
bacula-dir -t -c /etc/bacula/bacula-dir.conf
Features:
  • Distributed backup
  • Automation & scheduling
  • Encryption
  • Centralized management

6. Tools Backup di Windows

Windows Backup (wbadmin)

Native Windows backup tool

Create Backup:
# Backup system state dan data
wbadmin start backup -backupTarget:D: -include:C: -allCritical -quiet
Restore Backup:
# Restore files from backup
wbadmin start recovery -version:20241015 -itemType:File -items:C:\data
Features:
  • System state backup
  • Bare metal recovery
  • Volume shadow copy
  • GUI and CLI
Robocopy

Robust File Copy untuk Windows

Mirror Backup:
# Mirror directory structure
robocopy C:\Data D:\Backup\Data /MIR /Z /R:3 /W:5
Options:
  • /MIR Mirror directory tree
  • /Z Restartable mode
  • /R:3 3 retries on failure
  • /W:5 Wait 5 seconds between retries
  • /LOG:file Log to file
Advanced Usage:
# Backup dengan logging dan email notification
robocopy C:\Data D:\Backup\Data /MIR /Z /LOG+:C:\backup.log
VSS (Volume Shadow Copy Service): Windows service yang memungkinkan backup file yang sedang terbuka (open files) menggunakan snapshot untuk consistency.

7. Backup ke Cloud

AWS S3
Sync dengan AWS CLI:
# Sync local data ke S3
aws s3 sync /local/data/ s3://my-backup-bucket/data/
Features:
  • S3 Standard, Glacier
  • Versioning
  • Lifecycle policies
  • Encryption
Rclone
Cloud Sync Tool:
# Sync ke berbagai cloud providers
rclone copy /local/data remote:backup-bucket -P
Supported Clouds:
  • Google Drive
  • Dropbox
  • OneDrive
  • Amazon S3
  • Backblaze B2
Azure Blob
Azure CLI Backup:
# Upload batch ke Azure Blob
az storage blob upload-batch --destination backup-container --source C:\data
Features:
  • Hot/Cool/Archive tiers
  • Azure Backup Service
  • Integration dengan Azure VMs
  • Point-in-time restore

8. Verifikasi dan Testing Backup

Pentingnya Verifikasi: Backup yang tidak diverifikasi = tidak ada backup. Regular restore testing sangat critical.
Checklist Verifikasi:
  • Backup completed successfully
  • Data integrity checked (checksum)
  • File dapat dibaca dan di-restore
  • Metadata preserved (permission, timestamp)
  • Restore process documented
  • Recovery time within RTO
Automated Verification:
Verify Tar Archive
# Test integrity tar archive
tar -tzf backup.tar.gz > /dev/null && echo "OK" || echo "CORRUPT"
Checksum Verification
# Create checksum
md5sum backup.tar.gz > backup.tar.gz.md5

# Verify checksum
md5sum -c backup.tar.gz.md5

9. Best Practices Backup Strategy

3-2-1 Rule
3-2-1

3 copies of data

2 different media types

1 copy off-site

Encryption

Encrypt backup data:

  • At-rest encryption
  • In-transit encryption
  • Secure key management
Automation

Automate backup processes:

  • Scheduled backups
  • Monitoring & alerting
  • Regular testing
Documentation:
Document: Backup procedures, recovery runbooks, contact information, and escalation procedures.

10. Studi Kasus: Ransomware Recovery

Scenario:

Server perusahaan terkena ransomware. Semua data terenkripsi oleh penyerang dengan ekstensi .encrypted.

Recovery Plan:
1. Isolation

Isolate infected systems dari network

# Disconnect network
ifdown eth0
# atau
iptables -A INPUT -s 0.0.0.0/0 -j DROP
2. Identification

Identify clean backup dari sebelum infeksi

# Cari backup terakhir yang clean
ls -la /backup/
# Verifikasi checksum
md5sum -c backup_pre_attack.tar.gz.md5
3. Restoration

Restore data ke environment yang bersih

# Restore dari backup
tar -xzpf backup_clean.tar.gz -C /clean_environment/
# atau
rsync -av /backup/clean_data/ /production/
4. Verification & Hardening

Verify data integrity dan implement security patches

# Verify restored data
find /production/ -name "*.encrypted" | wc -l
# Should return 0

# Apply security updates
apt update && apt upgrade

11. Backup Strategy Simulator

Hitung Kebutuhan Backup Anda
Input Parameters:
Calculation Results:
Recommendation:

Ringkasan Pembelajaran

Pada pertemuan ini kita telah mempelajari strategi backup dan restore yang komprehensif, termasuk tools, best practices, dan recovery procedures.

Key Takeaways:
  • Pemahaman RTO/RPO dan retention policies
  • Penggunaan tools backup di Linux dan Windows
  • Strategi 3-2-1 backup rule
  • Prosedur recovery dari ransomware
Next Topic Preview:

Pertemuan berikutnya: Manajemen Proses - monitoring, kontrol, dan optimasi proses sistem.