Skip to Content
New to Genbox? Check out our Getting Started guide
Commandsbackup

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

ArgumentDescription
nameOptional. Environment name.

Options

OptionDescription
--label <text>Add a label/description to the backup
--db-onlyOnly backup database
--code-onlyOnly backup code
--exclude <list>Exclude paths from backup

Examples

Full Backup

gb backup feature-auth

Labeled Backup

gb backup feature-auth --label "Before major refactor"

Database Only

gb backup feature-auth --db-only

Code Only

gb backup feature-auth --code-only

What’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_abc123xyz

Retention

Backup TypeRetention
Manual30 days
Auto (pre-destroy)7 days
Labeled90 days

Notes

  • Backups are stored in encrypted cloud storage
  • Large environments may take several minutes
  • Consider labeling important backups
  • Check gb backups for list

See Also

Last updated on