Backup and Restore

Protect your Pimeleon router configuration with comprehensive backup strategies and disaster recovery procedures


Backup and Restore

"If you perceive that there are four possible ways in which a procedure can go wrong, and circumvent these, then a fifth way, unprepared for, will promptly develop." — Arthur Bloch, Murphy's Law

The only backup strategy that fails is the one you didn't implement.

Your Pimeleon router contains critical network configuration, custom settings, firewall rules, DNS filtering lists, and DHCP reservations. Regular backups ensure you can recover quickly from SD card failures, hardware issues, or configuration mistakes.

This guide covers everything from quick configuration exports to complete system imaging for disaster recovery.

Why Backups Matter

What You Risk Losing

Without backups, you could lose:

  • Network Configuration: DHCP settings, static IP assignments, DNS zones
  • Security Settings: Firewall rules, fail2ban configurations, VPN credentials
  • Service Configurations: DNS blocklists, custom DNS records, proxy settings
  • Customizations: All your carefully tuned settings and optimizations
  • Historical Data: Network statistics, query logs, blocked domain history

Common Failure Scenarios

SD Card Corruption (Most Common)

  • Cause: Power outages, improper shutdowns, SD card wear
  • Impact: System won't boot or boots with corrupted configuration
  • Recovery Time: 2-4 hours without backup, 15-30 minutes with backup

Configuration Mistakes

  • Cause: Incorrect firewall rule, bad DNS setting, DHCP misconfiguration
  • Impact: Network becomes unreachable or services fail
  • Recovery Time: Hours of troubleshooting vs. instant restore

Hardware Failure

  • Cause: Raspberry Pi failure, power supply issues
  • Impact: Need to rebuild on new hardware
  • Recovery Time: Days to recreate from memory vs. 1 hour with backup

Backup Strategies

Three-Level Approach

We recommend implementing three complementary backup levels:

Level 1: Configuration Backups (Daily)

  • Small file exports of settings only
  • Fast to create and restore
  • Protects against configuration mistakes
  • Requires: 10MB storage, 2 minutes

Level 2: Full SD Card Image (Weekly)

  • Complete bootable system copy
  • Restore entire router in minutes
  • Protects against SD card failure
  • Requires: 8-16GB storage, 30 minutes

Level 3: Cloud/Offsite Backup (Weekly)

  • Remote storage of critical data
  • Protects against physical disasters
  • Enables recovery from anywhere
  • Requires: Cloud storage account

Configuration Backups (Level 1)

What Gets Backed Up

Configuration backups include:

  • system configuration and blocklists
  • DHCP server settings and reservations
  • DNS zone files and custom records
  • Firewall rules and security policies
  • Network interface configurations
  • Service settings (Tor, Privoxy, Squid)
  • System timezone and hostname

Creating Configuration Backups

DNS Filtering Settings:

  1. Access admin interface panel: http://pimeleon.local/admin
  2. Login with your password
  3. Navigate to Settings → Teleporter
  4. Click Backup to download configuration
  5. Save file as: pihole-backup-YYYY-MM-DD.tar.gz

What's included:

  • Gravity database (blocklists)
  • Custom DNS records
  • DHCP reservations
  • Whitelist/blacklist
  • Group assignments
  • Client configurations

Backup Frequency Recommendations

Manual Backups:

  • After major configuration changes
  • Before system updates
  • Weekly as part of routine maintenance

Backup Storage:

  • Download backup files to your computer
  • Store backups on USB drive or network storage
  • Keep multiple backup versions (at least 3-4 recent backups)

Restoring Configuration Backups

Restore DNS Filtering Configuration

  1. Access admin interface: http://pimeleon.local/admin
  2. Navigate to Settings → Teleporter
  3. Click Choose File and select your backup file
  4. Click Restore and wait for completion
  5. System will automatically restart services
  6. Verify settings were restored in web dashboard

What Gets Restored:

  • All DNS filtering settings and configurations
  • Blocklists and custom DNS records
  • DHCP reservations
  • Whitelist/blacklist entries
  • Group assignments and client settings

Full System Backups (Level 2)

Complete SD Card Image

A full SD card image creates a bootable clone of your entire system. This is the fastest disaster recovery method.

Advantages:

  • Complete system snapshot including OS, configurations, and data
  • Bootable image - flash to new SD card and you're running
  • Fastest recovery from hardware failure
  • Preserves all customizations and installed packages

Disadvantages:

  • Large file size (8-16GB compressed)
  • Takes 30-60 minutes to create
  • Requires specialized tools
  • Can't restore individual files easily

Creating SD Card Images

Using a Second SD Card Reader

The safest method is to create images while the system is running using a USB SD card reader.

Using Imaging Software:

Use graphical tools to create SD card backups on your computer:

  • Raspberry Pi Imager (supports reading SD cards in newer versions)
  • Win32 Disk Imager (Windows)
  • balenaEtcher
  • SD Card Copier (built into Raspberry Pi OS)

Windows Method - Win32 Disk Imager:

  1. Download Win32 Disk Imager
  2. Install and run as Administrator
  3. Insert SD card in USB reader
  4. Select your SD card drive letter
  5. Choose save location: C:\Backups\pimeleon-backup-YYYYMMDD.img
  6. Click Read to create image
  7. Wait 30-60 minutes for completion
  8. Compress with 7-Zip to save space

Alternative - Raspberry Pi Imager:

Recent versions of Raspberry Pi Imager can also read SD cards:

  1. Launch Raspberry Pi Imager
  2. Click Choose Device → Select your Pi model
  3. Click Choose OS → Scroll to Use custom
  4. In newer versions, look for backup/clone options
  5. Follow on-screen instructions

Restoring from SD Card Image

Complete System Restore:

  1. Power off Pimeleon router (unplug power)
  2. Remove SD card from Raspberry Pi
  3. Flash backup image to SD card:
    Using Raspberry Pi Imager:
    • Launch Raspberry Pi Imager
    • Choose Device → Select your Pi model
    • Choose OS → Use custom → Select your backup .img or .img.gz file
    • Choose Storage → Select your SD card
    • Click Write
    • Wait for completion (15-30 minutes)

    Using Win32 Disk Imager (Windows):
    • Launch Win32 Disk Imager as Administrator
    • Select your backup image file
    • Select SD card drive letter
    • Click Write
    • Wait for completion
  4. Insert SD card back into Raspberry Pi
  5. Power on - system boots exactly as it was when backed up
  6. Verify functionality:
    • Check green LED blinks (system is booting)
    • Wait 2-3 minutes for full boot
    • Access web dashboard: http://pimeleon.local/admin
    • Verify all services show as "Active"
    • Test internet connectivity from connected devices

Recovery Time: 20-35 minutes (mostly flashing time)

Cloud/Offsite Backups (Level 3)

Manual Cloud Storage

For offsite backup protection:

  1. Download Configuration Backups:
    • Use the backup/restore feature to export configuration
    • Save backup files to your computer
  2. Upload to Cloud Storage:
    • Manually upload backup files to:
      • Google Drive
      • Dropbox
      • OneDrive
      • iCloud
      • Any cloud storage service
  3. Backup Schedule:
    • Weekly uploads recommended
    • Keep 3-4 recent backups
    • Delete older backups after 90 days
  4. For SD Card Images:
    • Compress images before upload (use .zip or .gz)
    • Consider splitting large files if needed
    • Only upload monthly (images are large)

Testing Your Backups

"Untested backups are not backups, they're hopes and prayers."

Validation Checklist

Monthly Backup Test:

  1. Verify backup files exist:
    • Check your backup storage location
    • Verify files are recent (check dates)
  2. Test DNS filtering restore:
    • Try restoring a backup in the web interface Teleporter
    • Verify no errors appear
    • Can revert immediately if needed
  3. Quarterly full test (recommended):
    • Use spare SD card
    • Flash a backup image
    • Boot test system
    • Verify all services work

Warning Signs:

  • Backup files haven't updated recently
  • Backup files are unusually small (may be incomplete)
  • Cannot access backup storage location
  • Restoration attempts fail with errors

Disaster Recovery Procedures

Complete System Loss Scenario

Situation: SD card failed, Pimeleon router won't boot.

Recovery Steps:

  1. Obtain new SD card (32GB+, Class 10 or better)
  2. Flash most recent full image:
    • Use Raspberry Pi Imager
    • Select your backup .img file as custom OS
    • Flash to new SD card
    • Insert in Raspberry Pi and power on
  3. If no full image, fresh install + restore configs:
    • Flash fresh Pimeleon image from [downloads/downloads/)
    • Boot system and complete first-boot setup
    • Access admin interface
    • Use Teleporter to restore configuration backup
    • Verify all settings restored correctly
  4. Verify services:
    • Check web dashboard shows all services "Active"
    • Verify DNS queries appearing in Query Log
    • Check DHCP Status (if using Gateway Mode)
  5. Test network functionality:
    • Connect client device
    • Verify device gets IP address (DHCP)
    • Test websites load properly
    • Verify ads are blocked
    • Check internet access works

Recovery Time Estimate:

  • With full SD card image: 30-45 minutes
  • With config backups only: 1-2 hours
  • From scratch (no backups): 3-4 hours

Configuration Mistake Scenario

Situation: Made configuration change, now can't access router.

Recovery Steps:

  1. Power cycle the router:
    • Unplug power for 10 seconds
    • Plug back in and wait for boot
    • Some misconfigurations may self-correct
  2. Use the backup/restore feature restore:
    • If you can still access web interface
    • Navigate to Settings → Teleporter
    • Restore a previous working configuration
  3. Complete restore from SD card backup:
    • Power off Pi
    • Flash backup image to SD card
    • This will restore entire working system
    • Fastest recovery for critical issues
  4. Last resort - Fresh installation:
    • Flash fresh Pimeleon image
    • Complete first-boot setup
    • Restore configuration from Teleporter backup
    • Reconfigure any custom settings

Best Practices

Backup Schedule Recommendations

After major changes: system configuration export (via Teleporter) Weekly: system configuration backup Monthly: Full SD card image backup Quarterly: Test restore on spare hardware

Storage Recommendations

Local Storage:

  • Keep 3-4 recent configuration backups
  • Keep 2-3 most recent SD card images (if space allows)
  • Store on external USB drive, computer, or NAS

Cloud Storage:

  • Store configuration backups with 90-day retention
  • Consider monthly SD card image uploads (they're large)
  • Use cloud services with encryption (Google Drive, Dropbox, etc.)

Security Considerations

Backup Protection:

  • Store backup files securely on your computer
  • Use cloud services with good security (encryption at rest)
  • Don't share backup files publicly
  • Keep backup file permissions restricted

What Backups Contain:

Configuration backups may include sensitive information:

  • Network topology and IP addresses
  • DHCP client information
  • Custom DNS records
  • WiFi passwords (if configured)
  • Firewall rules

Treat backup files as confidential data.

What NOT to Backup

Exclude these from backups:

  • Temporary files (/tmp, /var/tmp)
  • Log files (they regenerate)
  • Package cache (/var/cache/apt)
  • Query database (unless you need history)
  • Swap files

Privacy Considerations:

Configuration backups may contain:

  • DHCP client hostnames and MAC addresses
  • DNS query history (if included)
  • Network topology information
  • WiFi passwords

Encrypt backups if storing offsite or in cloud.

Quick Reference

Essential Backup Steps

Configuration Backup:

  1. Access admin interface: http://pimeleon.local/admin
  2. Settings → Teleporter
  3. Click "Backup"
  4. Save file with date: pihole-backup-YYYY-MM-DD.tar.gz

Full System Backup:

  1. Power off Pimeleon
  2. Remove SD card
  3. Use Raspberry Pi Imager or Win32 Disk Imager to create image
  4. Save as: pimeleon-backup-YYYY-MM-DD.img
  5. Compress if needed

Restore Configuration:

  1. Access admin interface
  2. Settings → Teleporter
  3. Choose backup file
  4. Click "Restore"
  5. Wait for completion

Restore Full System:

  1. Flash backup image to SD card using Raspberry Pi Imager
  2. Insert SD card in Pi
  3. Power on

Troubleshooting

"Can't access Teleporter backup"

  • Verify you're logged into admin interface
  • Check browser isn't blocking file downloads
  • Try different browser

"Restore shows errors"

  • Verify backup file isn't corrupted
  • Check backup file is for same Pimeleon version
  • Try older backup if available

"Image won't flash to SD card"

  • Verify SD card is working and not write-protected
  • Try different SD card
  • Use Raspberry Pi Imager instead of other tools
  • Check image file isn't corrupted

"System doesn't boot after restore"

  • Verify correct image for your Pi model (RPi3 vs RPi4)
  • Check SD card is properly seated
  • Try reflashing the image
  • Verify power supply is adequate

Next Steps

  • Create your first system configuration backup
  • Create your first full SD card image backup
  • Test restore procedure on spare SD card (if available)
  • Upload backups to cloud storage for offsite protection
  • Set calendar reminders for:
    • Weekly configuration backups
    • Monthly SD card image backups
    • Quarterly backup testing

Remember: The best time to implement a backup strategy is before you need it. The second-best time is right now.