Skip to main content
Migration tools often need features that transaction pooling does not support, such as session-level advisory locks. Databases with managed SQL roles can request a short-lived direct connection that bypasses PgBouncer.

Request access

Request access from the database page under Direct migration connection, through the API, or with dbhost databases migration-request (CLI 0.3.7 or newer). Provide:
  • one or two exact public IP addresses of your migration runner; no CIDR ranges or wildcards
  • a lease: 30, 60 or 120 minutes in the dashboard, or 10–120 minutes through the API and CLI
  • 1 or 2 concurrent sessions
DBHost reserves the request, checks the database, the PostgreSQL TLS certificate and the session budget, opens the network path for your exact IPs only, and then enables the migration login. This usually takes under a minute, and the dashboard follows the steps (Preparing access, Opening the network path, Active until …) without a reload. The lease’s time starts when the login is prepared, so waiting never shortens it. If access cannot be opened safely, the request closes and the dashboard says why; request again.

Connect

The active profile shows migrate.dbhost.app:5432, database name, a dedicated migration username and expiry. Use sslmode=verify-full and the password revealed by the owner in the dashboard or returned by dbhost databases migration-credentials <database-id> --show-secret and the owner-scoped API. See TLS connections for client certificate settings. Keep that password in your CI secret store; never commit it or put it in a command URL. The migration login starts with the database owner as its effective SQL role, so migration tools create objects under the same owner as the rest of the managed database. It does this through SET role: current_user returns the owner role, while session_user returns the migration login dbr_<id>_migr. Both are expected. It cannot create roles or databases and allows at most the one or two sessions you requested. Your application runtime URL stays on PgBouncer at port 6432. Use one runner per database even when the role permits two connections. Do not use a wildcard source IP or a dynamic CI egress address; use a runner with stable public egress. Schema changes and logical backup/restore cannot be promised as one consistent point while your own DDL is in flight. To finish early, click Revoke migration access or run dbhost databases migration-revoke <database-id> --yes. New logins stop and existing migration sessions are disconnected, and DBHost removes the matching network rules. At expiry, DBHost does the same on its own. A second request waits until that cleanup is finished, which usually takes under a minute. If the API returns FEATURE_NOT_AVAILABLE, the channel is not available for this database, typically because it has no managed SQL roles. Run migrations with the owner login through PgBouncer instead, and avoid tools that depend on session-level features.