Skip to content

hohu migrate ​

Run database migrations and built-in data synchronization separately in Docker deployments. Use hohu init for development initialization. Normal deployments and image updates already migrate data, so this command is usually unnecessary separately.

Prerequisites ​

  • Docker and Docker Compose are available, with initialized .hohu/deploy/ configuration.
  • Deployment .env targets the correct database and matching application images; the migrator image exists or can be pulled.
  • Complete required backups using upgrade and recovery, and confirm migration starting state and maintenance timing.

Run from the deployment configuration's parent directory or a subdirectory.

Usage ​

bash
hohu migrate

There are no additional business options. --init, --no-migrate and --image-source are not accepted.

Process and results ​

  1. Load deployment configuration and explicitly start Compose postgres and redis services.
  2. Run migrations and seed synchronization in a temporary db-migrator container, removing it afterwards.
  3. Report completion. This command does not update source, rebuild application images or restart API/Web.

Seed synchronization preserves existing passwords, customizations and permissions. Check logs and database revision, start or update applications according to your deployment plan, and verify sign-in and affected features.

Current limitations ​

Standalone migrate explicitly starts built-in PostgreSQL/Redis without checking ENABLE_POSTGRES or ENABLE_REDIS. It also does not invoke deployment image source fallback.

For external databases/Redis or --image-source requirements, prefer integrated migrations in hohu deploy or hohu deploy pull. Check target images and configuration first: these commands also start or update applications.

Troubleshooting ​

SymptomAction
Deployment not initializedCheck working directory and .hohu/deploy/
Infrastructure fails to startCheck built-in service ports, storage and external service limitations
Migrator image unavailableCheck image reference and tag; use integrated deployment for source fallback
Connection or migration failsPreserve errors and logs, check database, permissions and revisions, then confirm recovery before retrying

After a migration failure, do not start applications requiring the new schema, delete the database or alter migration records to bypass the error.