Skip to content

lowtide-migrate CLI

lowtide-migrate assesses a Pub/Sub project and runs the steps of a topic migration yourself. The console’s Migration page runs the same steps through the cluster’s agent (Migrate from the console), so you need the CLI only if you prefer to run them from your shell.

It ships in the gateway image. Run it with Docker, for example in Cloud Shell:

Terminal window
alias lowtide-migrate='docker run --rm --entrypoint lowtide-migrate \
-e GOOGLE_OAUTH_ACCESS_TOKEN="$(gcloud auth print-access-token)" \
-e LOWTIDE_URL=https://pubsub.acme.internal \
-e LOWTIDE_CA_FILE=/ca.crt -v "$PWD/ca.crt:/ca.crt:ro" \
IMAGE_REPOSITORY:VERSION'

The alias reads your gcloud token once, when you define it. Tokens last an hour, so define the alias again for a longer session.

Credentials. GOOGLE_OAUTH_ACCESS_TOKEN, or else the metadata server (Application Default Credentials on Compute Engine, GKE or Cloud Shell). It uses the same token for Pub/Sub, Cloud Monitoring and lowtide.

Names. Topics and subscriptions are full names (projects/acme/topics/orders), or IDs with --project. A subscription can be in another project than its topic.

Command What it does
assess Inventory a project and say which topics can move, in which wave, and what they cost on Pub/Sub. Reads only.
create-resources Create the topic, its subscriptions and their dead-letter topics in lowtide.
mirror on Check that every subscription attached in Pub/Sub exists in lowtide, turn the mirror on and wait until it runs.
mirror status Show the mirror’s state, lag and errors, and each subscription in lowtide and in Pub/Sub.
handover Start a lowtide subscription where its Pub/Sub subscription stands.
finish Detach the Pub/Sub subscription once lowtide’s consumers keep up.
mirror off Turn the mirror off once no subscription is attached in Pub/Sub.

Every command except assess takes:

Flag / env Default Description
--lowtide-url / LOWTIDE_URL required lowtide’s REST endpoint, for example https://pubsub.acme.internal.
--lowtide-ca / LOWTIDE_CA_FILE none PEM CA certificate for lowtide’s TLS endpoint, for a private CA.
--project none Project for names given as IDs.
--pubsub-url https://pubsub.googleapis.com Pub/Sub API.
--monitoring-url https://monitoring.googleapis.com Cloud Monitoring API. "" turns it off.
Terminal window
lowtide-migrate assess --project acme > report.json
Flag Description
--project The project to assess. Required.
--out Write the report to this file instead of standard output.
--pubsub-url, --monitoring-url API endpoints, for testing.

Needs Pub/Sub Viewer (roles/pubsub.viewer) and Monitoring Viewer (roles/monitoring.viewer) on the project. It reads topics, subscriptions, snapshots and topic IAM policies, and, if it can reach Cloud Monitoring, 30 days of traffic volume. It sends nothing to lowtide. Assess a project explains the report.

Terminal window
lowtide-migrate create-resources --topic projects/acme/topics/orders

Creates the topic and every subscription attached to it in Pub/Sub, in lowtide, under the same names and settings, plus their dead-letter topics. Push, BigQuery and Cloud Storage subscriptions are created as pull subscriptions: their delivery starts at the hand-over, or they would deliver everything twice. Subscriptions are created to never expire until finish. Existing resources are kept. It refuses a topic that uses a feature lowtide doesn’t support.

Terminal window
lowtide-migrate mirror on --topic projects/acme/topics/orders
lowtide-migrate mirror status --topic projects/acme/topics/orders [--json]
lowtide-migrate mirror off --topic projects/acme/topics/orders [--force]

mirror on and mirror off set and remove the topic label lowtide-mirror=pubsub, the same as gcloud or Terraform would (Mirroring to Pub/Sub). mirror off refuses while a subscription of the topic is still attached in Pub/Sub, unless you pass --force.

mirror status shows whether the mirror runs, its lag, backlog and errors over the whole cluster, and for each subscription whether it exists in lowtide and is attached or detached in Pub/Sub, its type and Pub/Sub’s backlog age.

Terminal window
lowtide-migrate handover --subscription projects/acme/subscriptions/orders-billing \
--publishers-moved-at 2026-12-01T10:15:00Z
Flag Default Description
--subscription required The subscription to hand over.
--publishers-moved-at none When the last publisher moved to lowtide (RFC 3339). The command refuses a seek time before it.
--margin-seconds 60 Subtracted from the seek time, to cover the mirror’s lag.
--seek-to none Seek to this time (RFC 3339) instead of reading Cloud Monitoring.
--copy-delivery-config off For push, BigQuery and Cloud Storage subscriptions: copy the delivery settings from Pub/Sub after the seek, which starts delivery from lowtide.
--dry-run off Show the seek time without seeking.

Hand over subscriptions explains how the seek time is chosen and what to start and stop.

Terminal window
lowtide-migrate finish --subscription projects/acme/subscriptions/orders-billing
Flag Default Description
--subscription required The subscription that was handed over.
--max-lag-seconds 300 Refuse while lowtide’s oldest unacknowledged message is older than this.
--force off Detach even if the checks fail.
--dry-run off Run the checks only.

Checks that the lowtide subscription has consumers attached and keeps up, then sets the Pub/Sub subscription to never expire and detaches it.

Your credentials need, in each subscription’s project: Pub/Sub Editor (roles/pubsub.editor: get, update and detach subscriptions) and Monitoring Viewer (roles/monitoring.viewer). In lowtide, with authentication on: permission to create topics and subscriptions, get topics, update topic labels and seek subscriptions, for example Pub/Sub Editor on the project.