Cli
Restore
Restore
restore
Restore your Zodula data from a backup file.
Usage
nailgun restore [options]Options
-f, --file <path>- Path to the backup file to restore from
Description
The restore command restores your Zodula data from a previously created backup. It can work in interactive mode (showing available backups) or with a specific file path.
Interactive Mode
If no file path is provided, the command will:
- Look for the
.zodula_backupdirectory - List all available backup files
- Let you select which backup to restore
- Ask for confirmation before overwriting existing data
Direct Mode
If you provide a file path with -f or --file:
nailgun restore --file /path/to/backup.zipWhat It Does
- Lists available backups (in interactive mode)
- Asks for confirmation before overwriting existing data
- Removes existing
.zodula_datadirectory if it exists - Extracts the backup file
- Verifies the restoration was successful
- Runs migrations to ensure database consistency
Example
Interactive Mode
$ nailgun restore
📋 Found 3 backup(s):
1. zodula-backup-2023-12-21T10-30-45-123Z.zip (15.23 MB, 2023-12-21)
2. zodula-backup-2023-12-20T15-20-30-456Z.zip (12.45 MB, 2023-12-20)
3. zodula-backup-2023-12-19T09-15-20-789Z.zip (11.87 MB, 2023-12-19)
? Select a backup to restore: zodula-backup-2023-12-21T10-30-45-123Z.zip
? Are you sure you want to restore from /path/to/backup.zip? Yes
🔄 Restoring backup...
📦 Extracting backup...
✅ Backup restored successfully!
📁 Restored to: /path/to/.zodula_data
📊 Directory size: 15.23 MBDirect Mode
$ nailgun restore --file /path/to/backup.zip
📁 Using backup file: /path/to/backup.zip
? Are you sure you want to restore from /path/to/backup.zip? Yes
🔄 Restoring backup...
📦 Extracting backup...
✅ Backup restored successfully!Important Warnings
⚠️ Data Loss Warning: Restoring a backup will completely replace your current .zodula_data directory. All existing data will be lost.
When to Use
Use restore when:
- You need to recover from a backup
- You want to revert to a previous state
- You're setting up a development environment from a backup
- You need to restore after data corruption
Safety Features
- Confirmation Required: Always asks for confirmation before overwriting
- Backup Verification: Verifies the backup was extracted successfully
- Migration Application: Automatically runs migrations after restoration
- Error Handling: Provides clear error messages if restoration fails
Tips
- Always create a backup before restoring
- Test restorations in a development environment first
- Keep multiple backup versions
- Verify the backup file is not corrupted
- Ensure you have enough disk space for restoration
Troubleshooting
If restoration fails:
- Check that the backup file exists and is accessible
- Ensure you have write permissions
- Verify the backup file is not corrupted
- Check available disk space
- Try extracting the backup manually to test it
Zodula