cmd migrate - nself-org/cli GitHub Wiki

nself migrate

Detect and migrate ษณSelf v0.9.x projects to the current v1.x format.

Synopsis

nself migrate [subcommand] [flags]

Description

nself migrate detects and migrates v0.9.x project artifacts to the current v1.x format. Running nself migrate without a subcommand performs a detection scan, the same as nself migrate detect, and reports which v0.9 artifacts are present.

The run subcommand performs the full automated migration: it stops running containers, backs up the current project state to .nself/backup/{timestamp}/, moves nginx configs from the flat nginx/ layout to nginx/sites/ (v1 layout), regenerates docker-compose.yml, and prints a summary of every change made. The migration is idempotent: running it on an already-migrated project exits cleanly with no changes.

After migration, the CLI prints the exact nself plugin install commands for every v0.9 plugin detected in your .env. Run those commands to re-install your plugins using the signed v1 bundle system.

If anything goes wrong, use nself migrate rollback to restore from the automatic backup.

Note: nself migrate manages v0.9โ†’v1 project migration. For database schema migrations within a v1 project, see cmd-db.

Subcommands

Subcommand Description
detect Detect v0.9 artifacts in the current project and print a summary
run Full v0.9โ†’v1 migration: stop containers, backup, move configs, regenerate
rollback Restore from the most recent migration backup

Flags

Flag Default Description
--backup "" Specific backup timestamp to restore (for rollback, e.g. 20260417-143022)
--list false List available backups with timestamps and sizes (for rollback)
--help, -h โ€” Show help

Plugin re-install warning

After nself migrate run completes, the output includes a plugin re-install block:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  v0.9 PLUGINS DETECTED โ€” RE-INSTALL REQUIRED            โ”‚
โ”‚                                                         โ”‚
โ”‚  v0.9 plugin code is not compatible with v1 signed      โ”‚
โ”‚  bundles. Re-install your plugins using:                โ”‚
โ”‚                                                         โ”‚
โ”‚    nself plugin install ai mux notify cron              โ”‚
โ”‚                                                         โ”‚
โ”‚  Your license key is already set.                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The plugin list is generated from PLUGIN_<NAME>=true entries in your v0.9 .env. Plugin names are mapped from v0.9 naming to v1 bundle naming automatically.

CI fixture

A v0.9 test fixture lives at internal/migration/testdata/v0.9-fixture/. The GitHub Actions workflow .github/workflows/migration-fixture.yml runs migration regression tests on every push to main and nightly. To run locally:

go test -mod=vendor -run TestE2E ./internal/migration/...

Examples

# Scan for v0.9 artifacts (non-destructive)
nself migrate
nself migrate detect

# Perform the v0.9โ†’v1 migration
nself migrate run

# Restore from the most recent backup
nself migrate rollback

# List available backups
nself migrate rollback --list

# Restore from a specific backup
nself migrate rollback --backup 20260417-143022

See Upgrade-From-v0.9 for the full step-by-step migration guide.

โ† Commands | Home โ†’

โš ๏ธ **GitHub.com Fallback** โš ๏ธ