Skip to main content

Backup and Restore

Protect your data with PC2's backup system.

What Gets Backed Up

A PC2 backup includes:

  • User Files -- all files in your storage
  • Database -- metadata, sessions, settings
  • Identity -- node keypair and configuration
  • App Data -- WASM apps and configurations

Creating a Backup

From the UI

  1. Open Settings -> PC2 tab
  2. Click "Create Backup"
  3. Wait for completion
  4. Click "Download" to save the backup file locally

From Command Line

cd pc2-node
npm run backup

Backups are saved to data/backups/ as .tar.gz archives.

Restoring from Backup

Web UI Restore

  1. Open Settings -> PC2
  2. Click "Restore from Backup"
  3. Choose a backup file or upload one
  4. Confirm and wait for completion
  5. Node restarts automatically

Fresh Install Restore

npm start
open http://localhost:4200/restore

Upload your backup file and click Restore.

Command Line Restore

cd pc2-node
npm run restore -- --file data/backups/backup-2024-01-15.tar.gz

Best Practices

Frequency

Use CaseRecommended Frequency
Personal useWeekly
Active developmentDaily
Critical dataAfter every major change

Storage Locations

Keep backups in multiple locations:

  1. Local -- on the same server (quick restore)
  2. External Drive -- physical backup
  3. Cloud Storage -- off-site (encrypted)
  4. Another PC2 Node -- cross-backup with a friend

Encryption

Backups contain sensitive data. If storing off-site:

gpg -c backup-2024-01-15.tar.gz

Recovery Phrase vs Backup

Recovery PhraseFull Backup
RestoresNode identity onlyEverything
FilesNoYes
SettingsNoYes
Size12 wordsMB-GB
warning

Your recovery phrase restores node identity but NOT your files. Always keep full backups.

Automated Backups

Using Cron

crontab -e

# Add daily backup at 2 AM
0 2 * * * cd /path/to/pc2-node && npm run backup

Retention Policy

find /path/to/pc2-node/data/backups -mtime +7 -delete