Starting with AlloyDB Omni 15.5.4, you control AlloyDB Omni with common package-management tools.
If you have an existing installation of AlloyDB Omni, follow the instructions on this page to migrate to the new, single-image installation.
Prerequisites
Before you can start upgrading to the latest version of AlloyDB Omni, complete the following prerequisites, if you haven't done so already.
Upgrade to AlloyDB Omni 15.5.2
The latest AlloyDB Omni version that supports the AlloyDB Omni CLI is 15.5.2.
To check the version of AlloyDB Omni, run the following command:
sudoalloydbversion
The output looks similar to the following:
AlloyDB Omni CLI version: 1.6
AlloyDB Omni database server version: 15.5.2
If the output displays a database version earlier than 15.5.2, run the following command to upgrade:
sudoalloydbdatabase-serverupgrade
Gather information about your existing installation
Run the following command:
cat/var/alloydb/config/dataplane.conf
From the output of the cat command, note the values of the following variables for your reference:
DATADIR_PATH—for example, /var/alloydb/main
ENABLE_ALLOYDB_AI—for example, FALSE
PGPORT—for example, 5432
INSTANCE_TYPE—for example, PRIMARY/READ_REPLICA
Drop ScaNN indexes created with postgres_ann extension
The postgres_ann extension is renamed to alloyd_scann. If you have installed the postgres_ann extension and created ScaNN indexes using the extension, you must drop all ScaNN indexes and uninstall the extension before performing an upgrade.
To handle any impact to your database due to the renaming of the postgres_ann extension, complete the following steps:
Replace DATABASE_NAME with the name of the database where you want to run the query.
Save index definitions and parameters as a dump DDL using a utility like pg_dump to recreate the ScaNN indexes later.
pg_dump-stTABLE_NAMEDATABASE_NAME
Replace the following:
DATABASE_NAME: the name of the database.
TABLE_NAME: the name of the table.
Drop ScaNN Indexes that were created using the postgres_ann index.
DROPINDEXINDEX_NAME;
Replace INDEX_NAME with the name of the database where you want to run the query.
Verify that none of your databases include ScaNN indexes. Use the following SQL query to verify the deletion: The following sql should return an empty result set.
The arguments to docker run are the ones used in earlier versions of AlloyDB Omni, but you may further customize them. See Customize your AlloyDB Omni installation for details.
If your database instance type is PRIMARY, run the following command to create the following users. These are usernames which are unused at the moment, but reserved for future extensions.
fornameinalloydbagentalloydbexportalloydbiamgroupuseralloydbiamuseralloydbimportexportalloydbobservabilityalloydbsqllogicalalloydbsuperuser;doechodockerexec-itCONTAINER_NAMEpsql-hlocalhost-Upostgresalloydbadmin\-c"CREATE ROLE ${name} NOLOGIN;"\-c"CREATE TABLE ${name}_table();"\-c"ALTER TABLE ${name}_table OWNER TO ${name};"done
The AlloyDB Omni CLI uninstallation does not affect your data stored in AlloyDB Omni.
Recreate ScaNN indexes using alloydb_scann extension
After you upgrade AlloyDB Omni, the alloydb_scann extension is also installed. Complete the following steps to recreate ScaNN indexes that you dropped in the Drop ScaNN indexes created with postgres_ann extension section before the upgrade.
Create the alloydb_scann extension using the following steps:
To create the alloydb_scann extension, run the following query:
createextensionalloydb_scanncascade;
Verify that the alloydb_scann extension was created successfully.
select*frompg_extension;
Recreate ScaNN index for your table, and then restore the previous pg_dump DDL index definitions.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eThis page provides instructions for migrating from AlloyDB Omni versions 15.5.2 and earlier to the latest version, which uses package-management tools and a single-image installation.\u003c/p\u003e\n"],["\u003cp\u003eBefore upgrading, users must first upgrade to AlloyDB Omni version 15.5.2, gather information about their existing installation's configuration, and drop any ScaNN indexes created with the \u003ccode\u003epostgres_ann\u003c/code\u003e extension.\u003c/p\u003e\n"],["\u003cp\u003eThe upgrade process involves stopping the existing database, starting a new single-image container while mounting the existing data directory, and running specific commands for user creation and AlloyDB AI setup if applicable.\u003c/p\u003e\n"],["\u003cp\u003eAfter upgrading, users must reinstall the \u003ccode\u003ealloydb_scann\u003c/code\u003e extension, and then recreate ScaNN indexes to replace the old ones that had to be dropped before upgrading.\u003c/p\u003e\n"],["\u003cp\u003eThe old AlloyDB Omni CLI needs to be uninstalled as part of the upgrade, as the latest version doesn't use it.\u003c/p\u003e\n"]]],[],null,["# Migrate from AlloyDB Omni version 15.5.2 and earlier to the latest version\n\nSelect a documentation version: 15.5.5keyboard_arrow_down\n\n- [15.7.0](/alloydb/omni/15.7.0/docs/migrate-to-latest-version)\n- [15.5.5](/alloydb/omni/15.5.5/docs/migrate-to-latest-version)\n- [15.5.4](/alloydb/omni/15.5.4/docs/migrate-to-latest-version)\n\n\u003cbr /\u003e\n\nThis page provides instructions for migrating from version 15.5.2 and earlier to the latest version of AlloyDB Omni.\n\n\u003cbr /\u003e\n\nStarting with AlloyDB Omni 15.5.4, you control AlloyDB Omni with common package-management tools.\n\nIf you have an existing installation of AlloyDB Omni, follow the instructions on this page to migrate to the new, single-image installation.\n\nPrerequisites\n-------------\n\nBefore you can start upgrading to the latest version of AlloyDB Omni, complete the following prerequisites, if you haven't done so already.\n\n### Upgrade to AlloyDB Omni 15.5.2\n\nThe latest AlloyDB Omni version that supports the AlloyDB Omni CLI is 15.5.2.\nTo check the version of AlloyDB Omni, run the following command: \n\n sudo alloydb version\n\nThe output looks similar to the following: \n\n AlloyDB Omni CLI version: 1.6\n AlloyDB Omni database server version: 15.5.2\n\nIf the output displays a database version earlier than 15.5.2, run the following command to upgrade: \n\n sudo alloydb database-server upgrade\n\n### Gather information about your existing installation\n\n1. Run the following command:\n\n cat /var/alloydb/config/dataplane.conf\n\n2. From the output of the `cat` command, note the values of the following variables for your reference:\n\n - \u003cvar translate=\"no\"\u003eDATADIR_PATH\u003c/var\u003e---for example, `/var/alloydb/main`\n - \u003cvar translate=\"no\"\u003eENABLE_ALLOYDB_AI\u003c/var\u003e---for example, `FALSE`\n - \u003cvar translate=\"no\"\u003ePGPORT\u003c/var\u003e---for example, `5432`\n - \u003cvar translate=\"no\"\u003eINSTANCE_TYPE\u003c/var\u003e---for example, `PRIMARY/READ_REPLICA`\n\n### Drop ScaNN indexes created with `postgres_ann` extension\n\n|\n| **Preview\n| --- AlloyDB ScaNN index**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThe `postgres_ann` extension is renamed to `alloyd_scann`. If you have installed the `postgres_ann` extension and created `ScaNN` indexes using the extension, you must drop all `ScaNN` indexes and uninstall the extension before performing an upgrade.\n\nTo handle any impact to your database due to the renaming of the `postgres_ann` extension, complete the following steps:\n\n1. [Run and connect to AlloyDB Omni.](/alloydb/omni/15.5.5/docs/run-connect)\n2. Identify all tables that use the `ScaNN` index.\n\n \\c \u003cvar translate=\"no\"\u003eDATABASE_NAME\u003c/var\u003e\n select schemaname, relname, indexrelname, indextype, indexconfig, indexsize, indexscan FROM pg_stat_ann_indexes;\n\n Replace \u003cvar translate=\"no\"\u003eDATABASE_NAME\u003c/var\u003e with the name of the database where you want to run the query.\n3. Save index definitions and parameters as a dump DDL using a utility like `pg_dump` to recreate the `ScaNN` indexes later.\n\n pg_dump -st \u003cvar translate=\"no\"\u003eTABLE_NAME\u003c/var\u003e \u003cvar translate=\"no\"\u003eDATABASE_NAME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eDATABASE_NAME\u003c/var\u003e: the name of the database.\n - \u003cvar translate=\"no\"\u003eTABLE_NAME\u003c/var\u003e: the name of the table.\n4. Drop `ScaNN` Indexes that were created using the `postgres_ann` index.\n\n DROP INDEX \u003cvar translate=\"no\"\u003eINDEX_NAME\u003c/var\u003e;\n\n Replace \u003cvar translate=\"no\"\u003eINDEX_NAME\u003c/var\u003e with the name of the database where you want to run the query.\n | **Note:** If the index is not successfully dropped before upgrading, then the table will be not used and queried in subsequent query requests.\n5. Verify that none of your databases include `ScaNN` indexes. Use the following SQL query to verify the deletion: The following sql should return an empty result set.\n\n \\c \u003cvar translate=\"no\"\u003eDATABASE_NAME\u003c/var\u003e\n select schemaname, relname, indexrelname, indextype, indexconfig, indexsize, indexscan FROM pg_stat_ann_indexes;\n\n6. Drop the `postgres_ann` extension using the following steps:\n\n 1. Verify that the `postgres_ann` extension is installed in your database.\n\n select * from pg_extension;\n\n 1. Drop the `postgres_ann` extension.\n\n DROP EXTENSION postgres_ann CASCADE;\n\n 1. Verify that the `postgres_ann` extension is no longer installed in your database.\n\n select * from pg_extension;\n\nPerform an in-place upgrade\n---------------------------\n\n1. Stop the existing database:\n\n sudo alloydb database-server stop\n\n2. Start the new single-image AlloyDB Omni, mounting your existing data directory from before:\n\n docker run --name \u003cvar translate=\"no\"\u003eCONTAINER_NAME\u003c/var\u003e \\\n -e POSTGRES_PASSWORD=\u003cvar translate=\"no\"\u003ePASSWORD\u003c/var\u003e \\\n -e PGDATA=/var/lib/postgresql/data \\\n -v /var/alloydb/main/data:/var/lib/postgresql/data \\\n -v /dev/shm:/dev/shm \\\n -p \u003cvar translate=\"no\"\u003ePGPORT\u003c/var\u003e:5432 \\\n --network=host \\\n --ulimit=nice=-20:-20 \\\n --ulimit=core=-1:-1 \\\n --log-driver=journald \\\n -d google/alloydbomni:15.5.5\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCONTAINER_NAME\u003c/var\u003e: The name to assign this new AlloyDB Omni container in your host machine's container registry---for example, `my-omni`.\n\n - \u003cvar translate=\"no\"\u003ePASSWORD\u003c/var\u003e: The password assigned the new container's `postgres` user after its creation.\n\n - \u003cvar translate=\"no\"\u003ePGPORT\u003c/var\u003e: The IP address of the port the AlloyDB Omni runs on. This is the value you noted down in step 2 of [Gather information about your existing installation](#gather-information).\n\n The arguments to `docker run` are the ones used in earlier versions of AlloyDB Omni, but you may further customize them. See [Customize your AlloyDB Omni installation](/alloydb/omni/15.5.5/docs/install) for details.\n3. If your database instance type is `PRIMARY`, run the following command to create the following users. These are usernames which are unused at the moment, but reserved for future extensions.\n\n for name in alloydbagent alloydbexport alloydbiamgroupuser alloydbiamuser alloydbimportexport alloydbobservability alloydbsqllogical alloydbsuperuser; do\n echo docker exec -it \u003cvar translate=\"no\"\u003eCONTAINER_NAME\u003c/var\u003e psql -h localhost -U postgres alloydbadmin \\\n -c \"CREATE ROLE ${name} NOLOGIN;\" \\\n -c \"CREATE TABLE ${name}_table();\" \\\n -c \"ALTER TABLE ${name}_table OWNER TO ${name};\"\n done\n\n4. If `ENABLE_ALLOYDB_AI` is set to `TRUE`, follow instructions in [Install AlloyDB Omni with AlloyDB AI](/alloydb/omni/15.5.5/docs/install-with-alloydb-ai) to set up AlloyDB AI.\n\n5. Connect to the database to verify that the data is unchanged:\n\n docker exec -it \u003cvar translate=\"no\"\u003eCONTAINER_NAME\u003c/var\u003e psql -h localhost -U postgres\n\n6. Uninstall the AlloyDB Omni CLI:\n\n sudo alloydb database-server uninstall\n\n The AlloyDB Omni CLI uninstallation does not affect your data stored in AlloyDB Omni.\n\nRecreate ScaNN indexes using `alloydb_scann` extension\n------------------------------------------------------\n\nAfter you upgrade AlloyDB Omni, the `alloydb_scann` extension is also installed. Complete the following steps to recreate ScaNN indexes that you dropped in the [Drop ScaNN indexes created with `postgres_ann` extension](#drop-extension-postgres-ann) section before the upgrade.\n\n1. Create the `alloydb_scann` extension using the following steps:\n\n 1. To create the `alloydb_scann` extension, run the following query:\n\n create extension alloydb_scann cascade;\n\n 1. Verify that the `alloydb_scann` extension was created successfully.\n\n select * from pg_extension;\n\n2. Recreate `ScaNN` index for your table, and then restore the previous `pg_dump` DDL index definitions.\n\n 1. Create `ScaNN` index on the table:\n\n CREATE INDEX \u003cvar translate=\"no\"\u003eINDEX_NAME\u003c/var\u003e ON \u003cvar translate=\"no\"\u003eTABLE_NAME\u003c/var\u003e\n USING scann (\u003cvar translate=\"no\"\u003eVECTOR_COLUMN\u003c/var\u003e \u003cvar translate=\"no\"\u003eDISTANCE\u003c/var\u003e)\n WITH (num_leaves = \u003cvar translate=\"no\"\u003eNUM_LEAVES_VALUE\u003c/var\u003e);\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eINDEX_NAME\u003c/var\u003e: the name of the index.\n - \u003cvar translate=\"no\"\u003eTABLE_NAME\u003c/var\u003e: the name of the table.\n - \u003cvar translate=\"no\"\u003eVECTOR_COLUMN\u003c/var\u003e: the name of the column that stores vector data.\n - \u003cvar translate=\"no\"\u003eDISTANCE\u003c/var\u003e: the distance function to use with this index.\n - \u003cvar translate=\"no\"\u003eNUM_LEAVES_VALUE\u003c/var\u003e: the number of partitions to apply to the index.\n\n 1. Verify that the index is created.\n\n \\d TABLE_NAME\n\n 1. Recommended: Backup your indexes data. We recommend creating a backup of your database and indexes as a best practice.\n\n | **Caution:** Any backup that includes the `postgres_ann` extension and was taken before the upgrade cannot be restored after the upgrade."]]