Migration from v1
Guide: Migrating from v1 (Bash CLI) to v2 (Go CLI)
Section titled “Guide: Migrating from v1 (Bash CLI) to v2 (Go CLI)”ɳSelf v1 was a Bash-based CLI. v2 is a complete Go rewrite with a new configuration format, Docker naming conventions, and improved safety. This guide walks you through the upgrade process.
For a summary of breaking changes, see Upgrading-from-v1.
Before You Begin
Section titled “Before You Begin”- Back up your data. The migration command does this automatically, but run a manual dump first:
Terminal window # On your v1 installationnself db dump - Know your current
.envvalues, especiallyPOSTGRES_PASSWORD,HASURA_GRAPHQL_ADMIN_SECRET, andHASURA_JWT_KEY.
Breaking Changes
Section titled “Breaking Changes”| v1 Env Var | v2 Equivalent | Notes |
|---|---|---|
NHOST_SUBDOMAIN | PROJECT_NAME | Required |
NHOST_REGION | (removed) | No cloud regions in v2 |
NHOST_BACKEND_URL | BASE_DOMAIN | Domain only, not full URL |
STORAGE_ENABLED | MINIO_ENABLED | |
S3_BUCKET | MINIO_DEFAULT_BUCKET | |
S3_ACCESS_KEY | MINIO_ACCESS_KEY | |
S3_SECRET_KEY | MINIO_SECRET_ACCESS_KEY | |
AUTH_SMTP_HOST | SMTP_HOST | |
GRAPHQL_JWT_SECRET | HASURA_GRAPHQL_JWT_SECRET | |
NHOST_ENV | ENV | Normalised: development → dev |
Docker resource names also changed:
| Resource | v1 Pattern | v2 Pattern |
|---|---|---|
| Network | nself{project} | {project}_default |
| Container | nself{project}_{service} | {project}_{service}_1 |
| Volume | nself{project}_{service} | {project}_{service} |
Migration Steps
Section titled “Migration Steps”1. Install ɳSelf v1.0.0 (Go rewrite)
Section titled “1. Install ɳSelf v1.0.0 (Go rewrite)”brew upgrade nself-org/nself/nselfnself version # should show v1.0.x2. Run the migration command
Section titled “2. Run the migration command”Navigate to your project directory:
cd /path/to/my-project
# Dry run first, shows what will change without modifying anythingnself migrate run --dry-run
# Run migration with automatic backupnself migrate run --backupThe migration command:
- Detects the v1 installation
- Creates a backup at
~/.nself/migration-backups/{timestamp}/ - Stops v1 containers
- Maps v1 env vars to v2 format
- Runs
nself buildto generate v2 configs - Renames the Docker network
- Starts v2 services
- Verifies health
3. Verify
Section titled “3. Verify”nself health # all services should be healthynself urls # confirm URLs are correctRollback
Section titled “Rollback”If anything goes wrong, roll back to v1 using the backup created in step 2:
nself migrate list # list available backupsnself migrate rollback --to-backup 20260328120000Rollback restores your .env files, docker-compose.yml, and project state, then restarts v1 containers.
See Also
Section titled “See Also”- Upgrading-from-v1: breaking changes summary
- cmd-migrate: migrate command reference
- Installation: fresh v2 install