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
- Open Settings -> PC2 tab
- Click "Create Backup"
- Wait for completion
- 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
- Open Settings -> PC2
- Click "Restore from Backup"
- Choose a backup file or upload one
- Confirm and wait for completion
- 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 Case | Recommended Frequency |
|---|---|
| Personal use | Weekly |
| Active development | Daily |
| Critical data | After every major change |
Storage Locations
Keep backups in multiple locations:
- Local -- on the same server (quick restore)
- External Drive -- physical backup
- Cloud Storage -- off-site (encrypted)
- 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 Phrase | Full Backup | |
|---|---|---|
| Restores | Node identity only | Everything |
| Files | No | Yes |
| Settings | No | Yes |
| Size | 12 words | MB-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