gb backup
Create a backup of your Genbox environment.
Synopsis
gb backup [name] [options]Description
Creates a snapshot backup of your Genbox, including code, database, and configuration. Backups are stored in the cloud and can be restored later.
Arguments
| Argument | Description |
|---|---|
name | Optional. Environment name. |
Options
| Option | Description |
|---|---|
--label <text> | Add a label/description to the backup |
--db-only | Only backup database |
--code-only | Only backup code |
--exclude <list> | Exclude paths from backup |
Examples
Full Backup
gb backup feature-authLabeled Backup
gb backup feature-auth --label "Before major refactor"Database Only
gb backup feature-auth --db-onlyCode Only
gb backup feature-auth --code-onlyWhat’s Included
Full Backup
- All repository code
- Database dumps (MongoDB)
- Redis data (if persistent)
- PM2 configurations
- Environment files
Database Backup
- All collections
- Indexes
- Database users (optional)
Code Backup
- All git repositories
- Uncommitted changes
- Configuration files
Backup Output
Creating backup of 'feature-auth'...
Code: ✓ 156 MB (3 repos)
Database: ✓ 45.2 MB (12 collections)
Config: ✓ 2.1 KB
Backup ID: bkp_abc123xyz
Label: Before major refactor
Size: 201.2 MB
Expires: 30 days
Restore with: gb backups restore bkp_abc123xyzRetention
| Backup Type | Retention |
|---|---|
| Manual | 30 days |
| Auto (pre-destroy) | 7 days |
| Labeled | 90 days |
Notes
- Backups are stored in encrypted cloud storage
- Large environments may take several minutes
- Consider labeling important backups
- Check
gb backupsfor list
See Also
gb backups- List and manage backupsgb db sync- Sync from sourcegb destroy- Auto-backup before destroy
Last updated on