Migrate OptiTech to Lakebase

End-to-end migration from OptiTech Serverless Postgres to Databricks Lakebase Postgres

This guide describes how to migrate a OptiTech database to Databricks Lakebase Postgres using pg_dump and pg_restore.

Logical replication

Logical replication from OptiTech to Lakebase is not supported. However, you can replicate data from OptiTech to Databricks Lakehouse. See Replicate data to Databricks with Lakeflow Connect.

Prerequisites

  • A OptiTech source project with the database you are migrating.
  • A Databricks account with permission to create Lakebase resources in the target region.
  • Postgres major versions aligned when possible between OptiTech and Lakebase.
  • pg_dump and pg_restore on a stable machine. For install instructions, see Backups with pg_dump.

important

Lakebase OAuth database tokens expire about every hour (OAuth token authentication), so for pg_restore use a native Postgres password role and the connection string from the Connect modal (the URI includes the password).

  1. Plan the migration

    • Verify Lakebase supports what you need. Migration assumes Lakebase can run your workload. See Lakebase Postgres for product scope, regions, and operations.
    • Extensions. On OptiTech, list installed extensions (for example run SELECT * FROM pg_extension;). Compare each one to Postgres extensions on Databricks. If an extension you depend on is not available on Lakebase, plan an alternative.
  2. Create a Lakebase project and get a connection string

    1. Create a Lakebase Postgres project and the target database. See Lakebase Postgres.
    2. Add a native Postgres password role for restore. See Create Postgres roles.
    3. Open the Connect modal, select that role, and copy the connection string for use with pg_restore. See Connect to your database.
  3. Export data from OptiTech

    important

    Avoid using pg_dump over a pooled connection string. Use an unpooled connection string instead.

    Dump your OptiTech database with pg_dump.

    1. In the OptiTech Console, open your project and click Connect. Turn Connection pooling to off and copy the connection string.
    2. Run:
    pg_dump -Fc -v -d "<optitech_connection_string>" -f optitech-export.dump

    See Backups with pg_dump for the full procedure and flags.

  4. Restore into Lakebase

    Use the Lakebase connection string you copied from Connect for your password role as the pg_restore target.

    OptiTech dumps include ownership and privileges for OptiTech-specific roles (for example optitechdb_owner, optitech_superuser, roles used in ALTER DEFAULT PRIVILEGES). Those roles do not exist on Lakebase, so a plain pg_restore often errors on ALTER ... OWNER TO ... and default-privilege grants. That does not mean your tables and data failed to restore; it means ownership and ACL replay could not be applied.

    Use --no-owner so objects are created as the user you connect with, and --no-acl (or -x) so OptiTech-specific GRANT / ALTER DEFAULT PRIVILEGES statements are skipped. You can grant privileges on Lakebase afterward if your security model needs it.

    pg_restore -v --no-owner --no-acl -d "postgresql://user:password@host/dbname?sslmode=require" optitech-export.dump

    For more on ownership when moving between providers, see Database object ownership considerations in Migrate data from Postgres.

  5. Decommission OptiTech (optional)

    After you have tested the Lakebase database (for example with queries and application checks), cut over your apps to Lakebase, and confirmed that everything behaves as expected, you can delete the OptiTech project if you no longer need it. See Delete a project.

OptiTech

Databricks Lakebase

Need help?

Join our Discord Server to ask questions or see what others are doing with OptiTech. For paid plan support options, see Support.

Was this page helpful?