Looking for a little bit of guidance regarding updating our temporal-server from 1.6.3 to the latest 1.9.2. It is my understanding the that schema updates are backwards compatible, so if I am reading the release notes properly, since we are already running 1.6.3, I should only need to update the schema to version 1.7.0 and then 1.9.0 (both of which have Schema changes), and then 1.9.2 should work just fine. Am I understanding that correctly?
We ensure that any consecutive versions are compatible in terms of database schema upgrades,
features, and system behavior, however there is no guarantee that there is compatibility between any
2 non-consecutive versions.
However, the above from the documentation makes me think I am not correct? Or do I need to upgrade the schema AND version step by step?
Meaning, do I need to upgrade via Helm from 1.6.3 to 1.6.4 to 1.6.5 to 1.6.6, all the way up to 1.9.2, in order to guarantee all functionality? Do I need to run the postgres-upgrade tool with each version to support this as well, or just the versions I mentioned initially that contain schema changes?
Thanks for any pointers
EDIT: In my temporal database, I see schema_version shows 1.3, so I may need to make a stop at 1.5.0 as well since that includes schema changes?
1.6.x → 1.7.x: first upgrade main DB schema to 1.4, then upgrade to 1.7.x
1.7.x → 1.8.x: just upgrade server
1.8.x → 1.9.x: first upgrade main DB schema to 1.5, then upgrade to 1.9.x
when upgrading the schema, use the pre-build docker image with corresponding release version tags
Unfortunately, upgrading the schema seems to have recreated all our tables, losing our workflows.
Using temporalio/admin-tools:1.7.0, I set all my env vars and then /usr/local/bin/temporal-sql-tool update-schema -d /etc/temporal/schema/postgresql/v96/temporal/versioned which seemed to start from scratch. Redacting all of the action it took, it looks like this just started migrating us from 0.0 onward.
Schema updated from 0.0 to 1.0
…
Schema updated from 1.0 to 1.1
…
Schema updated from 1.1 to 1.2
…
Schema updated from 1.2 to 1.3
…
Schema updated from 1.3 to 1.4
Updating the schema on temporal_visibility then fails with
---- Executing updates for version 1.2 ----
ALTER TABLE queue ADD message_encoding VARCHAR(16) NOT NULL DEFAULT 'Json';
error executing statement:pq: relation "queue" does not exist
I actually attempted to upgrade the schema from 1.2 to 1.7, because the -y for dry-run is broken/removed. And by doing so, that was not a compatible version hop so the migration started the db over from scratch?
basically “dry run” option is not really dry run, it will actually create a database and perform schema updates (legacy from cadence). since this option is confusing, we removed it in later release.
so to sum up, plz only use temporal-sql-tool update-schema -d /etc/temporal/schema/postgresql/v96/temporal/versioned