Wenn Sie bereits eine Installation von AlloyDB Omni haben, folgen Sie der Anleitung auf dieser Seite, um zur neuen Installation mit einem einzelnen Image zu migrieren.
Vorbereitung
Bevor Sie mit dem Upgrade auf die neueste Version von AlloyDB Omni beginnen können, müssen Sie die folgenden Voraussetzungen erfüllen, sofern Sie dies noch nicht getan haben.
Upgrade auf AlloyDB Omni 15.5.2
Die neueste AlloyDB Omni-Version, die die AlloyDB Omni CLI unterstützt, ist 15.5.2.
Führen Sie den folgenden Befehl aus, um die Version von AlloyDB Omni zu prüfen:
sudoalloydbversion
Die Ausgabe sieht dann ungefähr so aus:
AlloyDB Omni CLI version: 1.6
AlloyDB Omni database server version: 15.5.2
Wenn in der Ausgabe eine Datenbankversion vor 15.5.2 angezeigt wird, führen Sie den folgenden Befehl aus, um ein Upgrade durchzuführen:
sudoalloydbdatabase-serverupgrade
Informationen zu Ihrer bestehenden Installation sammeln
Führen Sie dazu diesen Befehl aus:
cat/var/alloydb/config/dataplane.conf
Notieren Sie sich aus der Ausgabe des cat-Befehls die Werte der folgenden Variablen:
DATADIR_PATH, z. B. /var/alloydb/main
ENABLE_ALLOYDB_AI, z. B. FALSE
PGPORT, z. B. 5432
INSTANCE_TYPE, z. B. PRIMARY/READ_REPLICA
Direktes Upgrade durchführen
Beenden Sie die vorhandene Datenbank:
sudoalloydbdatabase-serverstop
Starten Sie das neue Einzelbild-AlloyDB Omni und hängen Sie Ihr vorhandenes Datenverzeichnis ein:
Die Argumente für docker run sind die, die in früheren Versionen von AlloyDB Omni verwendet wurden. Sie können sie aber weiter anpassen. Weitere Informationen finden Sie unter AlloyDB Omni-Installation anpassen.
Wenn der Typ Ihrer Datenbankinstanz PRIMARY ist, führen Sie den folgenden Befehl aus, um die folgenden Nutzer zu erstellen. Das sind Nutzernamen, die derzeit nicht verwendet werden, aber für zukünftige Erweiterungen reserviert sind.
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
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-02 (UTC)."],[[["\u003cp\u003eAlloyDB Omni version 15.5.4 and later versions are managed using standard package-management tools, marking a shift from previous management methods.\u003c/p\u003e\n"],["\u003cp\u003eExisting AlloyDB Omni installations must first be upgraded to version 15.5.2 before proceeding with the single-image installation.\u003c/p\u003e\n"],["\u003cp\u003eThe in-place upgrade process involves stopping the existing database, running a new single-image container using Docker, and mounting the existing data directory.\u003c/p\u003e\n"],["\u003cp\u003eAfter upgrading, the AlloyDB Omni CLI should be uninstalled as it is no longer used to manage the new version.\u003c/p\u003e\n"],["\u003cp\u003eYou may need to create specific users and set up AlloyDB AI after upgrading, depending on your instance type and whether AI is enabled.\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.4keyboard_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\nStarting with AlloyDB Omni 15.5.4, you control AlloyDB Omni with common package-management tools.\n\n\u003cbr /\u003e\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\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.4\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.4/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.4/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."]]