Gitlab Omnibus Update 14.0.12 to 14.6.2 PG::DuplicateTable: ERROR: relation “integrations_id_seq” already exists

We were attempting to run on our second attempt the upgrade from versions 14.0.12 to 14.6.2
Our first attempt failed due to background migration tasks that hadn’t been given the requisite time to complete and we cleared this by running sudo gitlab-rails c commands to ensure we had no background or pending jobs outstanding after restoring to version 14.0.12. We had to do a manual restore to 14.0.12 as we couldn’t see the web GUI nor use gitlab.

Our second attempt failed also, but with a different issue, which is the one we’re currently stuck on.

The update on PROD from version 14.0.12 to 14.6.2 reported a database duplicate error and failed to complete thus necessitating a rollback to version 14.0.12 again.

StandardError: An error has occurred, this and all later migrations canceled:
PG::DuplicateTable: ERROR: relation “integrations_id_seq” already exists
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/rename_table_helpers.rb:8:in `block in rename_table_safely’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/rename_table_helpers.rb:7:in `rename_table_safely’
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20210621043337_rename_services_to_integrations.rb:37:in `up’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:123:in `run_block’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:134:in `block in run_block_with_lock_timeout’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:129:in `run_block_with_lock_timeout’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:97:in `run’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/lock_retry_mixin.rb:29:in `ddl_transaction’
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:63:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load’
/opt/gitlab/embedded/bin/bundle:23:in `<main>'

We did a cursory search on the forums to see if the database entry can be removed prior to any further retries!

This was found to help the resolution:
https://forum.gitlab.com/t/migration-error-while-upgrading-from-14-0-to-14-1/61427/2

However we are unsure and don’t know if this is the official step and require assistance to get our version to 14.6.2 to eventually go to version 14.7.7

Whilst Gitlab is in a currently usable state, it is not at an acceptable security patched advisory release which is a high concern.
Any assistance and steps to perform the successful update would be much appreciated.