Backup Restore
هذا المحتوى غير متوفر بلغتك بعد.
Guide: Backup and Restore
Section titled “Guide: Backup and Restore”Protect your data with regular, tested backups.
Automated Backups (Recommended)
Section titled “Automated Backups (Recommended)”Install the backup plugin for scheduled, automated backups:
nself plugin install backupnself build && nself restartConfigure schedule and retention in .env:
BACKUP_SCHEDULE=0 2 * * * # daily at 2amBACKUP_RETENTION_DAYS=30 # keep 30 daysBACKUP_S3_BUCKET=my-backup-bucket # optional: upload to S3/MinIOManual Database Backup
Section titled “Manual Database Backup”nself db dumpWrites a pg_dump file to .nself/backups/ with a timestamped filename.
Backup to S3 / MinIO
Section titled “Backup to S3 / MinIO”Configure in .env (or .env.secrets):
BACKUP_S3_ENDPOINT=https://s3.amazonaws.comBACKUP_S3_BUCKET=my-backupsBACKUP_S3_ACCESS_KEY=AKIAIOSFODNN7EXAMPLEBACKUP_S3_SECRET_KEY=<secret>Compatible with AWS S3, MinIO, Cloudflare R2, Backblaze B2, and any S3-compatible provider.
Restore from Backup
Section titled “Restore from Backup”nself db restore .nself/backups/myproject_20260328_020000.sqlThe restore command:
- Stops application services (keeps Postgres running)
- Drops and recreates the target database
- Restores from the dump file
- Restarts services
Important: Test your restores regularly. Untested backups are not backups.
Backup Verification Checklist
Section titled “Backup Verification Checklist”- Backup job runs successfully (check logs:
nself logs backup) - Backup files appear in
.nself/backups/or S3 bucket - Restoration test succeeds on a staging instance
- Retention policy removes old files as expected
See Also
Section titled “See Also”- plugin-backup: backup plugin reference
- cmd-db: db command reference
- Guide-Production-Deployment: server setup