GitLab Upgrade issue - from v 13.5.0-ee.0 to 13.12.5-ee.0

Hello,
I have a blocking problem upon the upgrading procedure. I have an AMI with the current GitLab version (13.5.0) and I cannot upgrade to the version I am aiming for at the moment (13.12.5).

I managed to upgrade from an earlier version up to 13.5.0, and as far as I know, the steps are the same.

I launched a

sudo gitlab-ctl reconfigure

and a

sudo gitlab-rake db:migrate

Upon the “migrate” command, the following error arise, and gitlab goes into 500 (503 error).

== 20210413130011 AddPartitionedWebHookLogFk: migrating =======================
-- foreign_keys(:web_hook_logs_part_0c5294f417)
   -> 0.0024s
-- transaction_open?()
   -> 0.0000s
-- foreign_keys("gitlab_partitions_dynamic.web_hook_logs_part_0c5294f417_000000")
   -> 0.0023s
-- execute("ALTER TABLE gitlab_partitions_dynamic.web_hook_logs_part_0c5294f417_000000\nADD CONSTRAINT fk_rails_bb3355782d\nFOREIGN KEY (web_hook_id)\nREFERENCES web_hooks (id)\nON DELETE CASCADE\nNOT VALID;\n")
   -> 0.0009s
-- execute("ALTER TABLE gitlab_partitions_dynamic.web_hook_logs_part_0c5294f417_000000 VALIDATE CONSTRAINT fk_rails_bb3355782d;")
   -> 0.0015s
-- transaction_open?()
   -> 0.0000s
-- foreign_keys("gitlab_partitions_dynamic.web_hook_logs_part_0c5294f417_202108")
   -> 0.0022s
-- execute("ALTER TABLE gitlab_partitions_dynamic.web_hook_logs_part_0c5294f417_202108\nADD CONSTRAINT fk_rails_bb3355782d\nFOREIGN KEY (web_hook_id)\nREFERENCES web_hooks (id)\nON DELETE CASCADE\nNOT VALID;\n")
   -> 0.0009s
-- execute("ALTER TABLE gitlab_partitions_dynamic.web_hook_logs_part_0c5294f417_202108 VALIDATE CONSTRAINT fk_rails_bb3355782d;")
   -> 0.0015s
-- transaction_open?()
   -> 0.0000s
-- foreign_keys("gitlab_partitions_dynamic.web_hook_logs_part_0c5294f417_202109")
   -> 0.0022s
-- execute("ALTER TABLE gitlab_partitions_dynamic.web_hook_logs_part_0c5294f417_202109\nADD CONSTRAINT fk_rails_bb3355782d\nFOREIGN KEY (web_hook_id)\nREFERENCES web_hooks (id)\nON DELETE CASCADE\nNOT VALID;\n")
   -> 0.0008s
-- execute("ALTER TABLE gitlab_partitions_dynamic.web_hook_logs_part_0c5294f417_202109 VALIDATE CONSTRAINT fk_rails_bb3355782d;")
   -> 0.0013s
-- add_foreign_key(:web_hook_logs_part_0c5294f417, :web_hooks, {:column=>:web_hook_id, :on_delete=>:cascade, :name=>"fk_rails_bb3355782d", :validate=>true})
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "pg_constraint_conrelid_contypid_conname_index"
DETAIL:  Key (conrelid, contypid, conname)=(28942, 0, fk_rails_bb3355782d) already exists.
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/partitioning_migration_helpers/foreign_key_helpers.rb:66:in `block in add_concurrent_partitioned_foreign_key'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:121:in `run_block'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:130:in `block in run_block_with_lock_timeout'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:371:in `block in transaction'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:370:in `transaction'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:125:in `run_block_with_lock_timeout'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:95:in `run'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:397:in `with_lock_retries'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/partitioning_migration_helpers/foreign_key_helpers.rb:65:in `add_concurrent_partitioned_foreign_key'
/opt/gitlab/embedded/service/gitlab-rails/db/post_migrate/20210413130011_add_partitioned_web_hook_log_fk.rb:11:in `up'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'

Caused by:
ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "pg_constraint_conrelid_contypid_conname_index"
DETAIL:  Key (conrelid, contypid, conname)=(28942, 0, fk_rails_bb3355782d) already exists.
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/partitioning_migration_helpers/foreign_key_helpers.rb:66:in `block in add_concurrent_partitioned_foreign_key'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:121:in `run_block'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:130:in `block in run_block_with_lock_timeout'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:371:in `block in transaction'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:370:in `transaction'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:125:in `run_block_with_lock_timeout'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:95:in `run'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:397:in `with_lock_retries'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/partitioning_migration_helpers/foreign_key_helpers.rb:65:in `add_concurrent_partitioned_foreign_key'
/opt/gitlab/embedded/service/gitlab-rails/db/post_migrate/20210413130011_add_partitioned_web_hook_log_fk.rb:11:in `up'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'

I searched online and it seems that such a leap from version X to version Y is not supported. How can I upgrade safely from my current version (13.5.0) up to 13.12.5 ?

I looked at Upgrading GitLab | GitLab but the link does not cover my specific case

Thank you

G.