Skip to content

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.

  • Back up your data. The migration command does this automatically, but run a manual dump first:
    Terminal window
    # On your v1 installation
    nself db dump
  • Know your current .env values, especially POSTGRES_PASSWORD, HASURA_GRAPHQL_ADMIN_SECRET, and HASURA_JWT_KEY.
v1 Env Varv2 EquivalentNotes
NHOST_SUBDOMAINPROJECT_NAMERequired
NHOST_REGION(removed)No cloud regions in v2
NHOST_BACKEND_URLBASE_DOMAINDomain only, not full URL
STORAGE_ENABLEDMINIO_ENABLED
S3_BUCKETMINIO_DEFAULT_BUCKET
S3_ACCESS_KEYMINIO_ACCESS_KEY
S3_SECRET_KEYMINIO_SECRET_ACCESS_KEY
AUTH_SMTP_HOSTSMTP_HOST
GRAPHQL_JWT_SECRETHASURA_GRAPHQL_JWT_SECRET
NHOST_ENVENVNormalised: developmentdev

Docker resource names also changed:

Resourcev1 Patternv2 Pattern
Networknself{project}{project}_default
Containernself{project}_{service}{project}_{service}_1
Volumenself{project}_{service}{project}_{service}
Terminal window
brew upgrade nself-org/nself/nself
nself version # should show v1.0.x

Navigate to your project directory:

Terminal window
cd /path/to/my-project
# Dry run first, shows what will change without modifying anything
nself migrate run --dry-run
# Run migration with automatic backup
nself migrate run --backup

The migration command:

  1. Detects the v1 installation
  2. Creates a backup at ~/.nself/migration-backups/{timestamp}/
  3. Stops v1 containers
  4. Maps v1 env vars to v2 format
  5. Runs nself build to generate v2 configs
  6. Renames the Docker network
  7. Starts v2 services
  8. Verifies health
Terminal window
nself health # all services should be healthy
nself urls # confirm URLs are correct

If anything goes wrong, roll back to v1 using the backup created in step 2:

Terminal window
nself migrate list # list available backups
nself migrate rollback --to-backup 20260328120000

Rollback restores your .env files, docker-compose.yml, and project state, then restarts v1 containers.


Home | _Sidebar