If you find yourself having difficulty upgrading your Sourcegraph instance, one good option is to ensure that autoupgrade is disabled. This feature normally delegates the upgrade orchestration to the frontend service, but should be disabled as a baseline troubleshooting step when dealing with upgrade errors or constant OOB migrations.
To turn off autoupgrade without access to the UI, run the following command in pgsql:
UPDATE versions SET auto_upgrade = false WHERE service = 'frontend';