For the complete documentation index, see llms.txt. This page is also available as Markdown.

Migration from Legacy Deployment

Migrate from the legacy stackai-auto-docker deployment to the unified CLI

Migrate from the legacy stackai-auto-docker deployment to the unified StackAI CLI.

Prerequisites

  • Access to your existing stackai-auto-docker deployment

  • Your StackAI License Key and Azure Registry credentials

  • Root/sudo access on the server

Migration Steps

1

Install the CLI

curl -sSf https://install.stack.ai | bash
stackai --version
2

Initialize

stackai init

Follow the prompts to configure your public host, registry credentials, and service URLs.

3

Stop Old Deployment

cd /path/to/stackai-auto-docker
docker compose down
docker ps  # Verify no stackai containers running
4

Import Data

cd /path/to/stackai-auto-docker
sudo stackai system import --force

Use --dry-run first to preview what will be migrated.

5

Start and Verify

stackai deploy start
stackai deploy status

Access your domain to verify data migrated correctly.

TLS Certificates

If you have Let's Encrypt certificates:

sudo cp -L /etc/letsencrypt/live/DOMAIN/fullchain.pem ~/.config/stackai/config/nginx/certs/stackai.crt
sudo cp -L /etc/letsencrypt/live/DOMAIN/privkey.pem ~/.config/stackai/config/nginx/certs/stackai.key
sudo chown $USER:$USER ~/.config/stackai/config/nginx/certs/*
stackai deploy restart nginx

Rollback

Your old deployment is preserved. To rollback:


FAQ

Why does import require sudo?

Docker volumes (MongoDB, PostgreSQL, etc.) are owned by root. The CLI detects SUDO_USER and writes to the correct user directory, then fixes file ownership automatically after import.

What data gets migrated?

Data Volumes:

Source
Destination

mongodb/mongodb_data/

data/mongodb/

weaviate/weaviate_data/

data/weaviate/

supabase/volumes/db/data/supabase/postgresql/

data/supabase/postgresql/

supabase/volumes/storage/

data/supabase/storage/

temporalio/volumes/postgres/

data/temporal/

Configuration:

Source
Destination

stackend/*.toml

config/stackend/

nginx/*.conf

config/nginx/

supabase/volumes/db/*.sql

config/supabase/db/

Environment Variables:

All .env files (mongodb/, supabase/, stackend/, stackweb/, weaviate/, unstructured/) are merged into ~/.config/stackai/.env. Secrets are encrypted in secrets.vault.

How do I renew Let's Encrypt certificates after migration?
Can I generate self-signed certificates instead?

Browsers will show a security warning with self-signed certificates.

How long does migration take for large datasets (50GB+)?

The import uses staged sync and 8MB buffered I/O for efficiency:

  • 10-15 minutes per 100GB on SSD

  • Progress bars show per-volume status

  • Most copying happens before services stop, minimizing downtime

MongoDB won't start after migration

The database was likely running during import, causing journal corruption.

Fix:

"CLI not initialized" error during import

Run stackai init before importing. The import command requires the CLI to be fully initialized first.

Permission denied on vault file

File ownership wasn't fixed properly. Run:

Port already in use

Old containers are still running. Stop them:

Last updated

Was this helpful?