# keystone.common.sql.upgrades module

keystone.common.sql.upgrades.check_bootstrap_new_branch(branch, version_path, addn_kwargs)

  Bootstrap a new migration branch if it does not exist.

keystone.common.sql.upgrades.contract_schema(engine=None)

  Contract the database.

  This is run manually by the keystone-manage command once the keystone nodes have been upgraded to the latest release and will remove any old tables/columns that are no longer required.

keystone.common.sql.upgrades.expand_schema(engine=None)

  Expand the database schema ahead of data migration.

  This is run manually by the keystone-manage command before the first keystone node is migrated to the latest release.

keystone.common.sql.upgrades.get_alembic_config()

keystone.common.sql.upgrades.get_current_heads()

  Get the current head of each the expand and contract branches.

keystone.common.sql.upgrades.get_db_version(branch='expand', *, engine=None)

keystone.common.sql.upgrades.get_head_revisions()

  Get the available head for each the expand and contract branches.

keystone.common.sql.upgrades.get_version_branch_path(release=None, branch=None)

  Get the path to a version branch.

keystone.common.sql.upgrades.migrate_data(engine=None)

  Migrate data to match the new schema.

  This is run manually by the keystone-manage command once the keystone schema has been expanded for the new release.

keystone.common.sql.upgrades.offline_sync_database_to_version(version=None, *, engine=None)

  Perform and off-line sync of the database.

  Migrate the database up to the latest version, doing the equivalent of the cycle of –expand, –migrate and –contract, for when an offline upgrade is being performed.

  If a version is specified then only migrate the database up to that version. Downgrading is not supported. If version is specified, then only the main database migration is carried out - and the expand, migration and contract phases will NOT be run.

this page last updated: 2026-06-11 21:52:50

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug