Packaged Postgresql Error after update from 12.7 to 13

HI, i’ve recently updatede my Gitlab local instance from 12.7.6 to 13.1.1, when the update script is running i get an error “Error executing action run on resource 'bash[migrate gitlab-rails database”
I’ve checked the status and i get:
run: alertmanager: (pid 12844) 6821s; run: log: (pid 10186) 7320s
run: gitaly: (pid 12869) 6820s; run: log: (pid 10160) 7320s
run: gitlab-exporter: (pid 12896) 6819s; run: log: (pid 10181) 7320s
run: gitlab-workhorse: (pid 12910) 6819s; run: log: (pid 10152) 7320s
run: grafana: (pid 12926) 6819s; run: log: (pid 10184) 7320s
run: logrotate: (pid 31354) 3218s; run: log: (pid 10159) 7320s
run: nginx: (pid 12948) 6818s; run: log: (pid 10153) 7320s
run: node-exporter: (pid 13036) 6817s; run: log: (pid 10163) 7320s
run: postgres-exporter: (pid 13046) 6817s; run: log: (pid 10172) 7320s
down: postgresql: 0s, normally up, want up; run: log: (pid 10139) 7321s
run: prometheus: (pid 13223) 6786s; run: log: (pid 10165) 7320s
run: redis: (pid 13242) 6785s; run: log: (pid 10137) 7321s
run: redis-exporter: (pid 13247) 6785s; run: log: (pid 10156) 7320s
run: sidekiq: (pid 15145) 6s; run: log: (pid 10155) 7320s
run: unicorn: (pid 15163) 1s; run: log: (pid 10151) 7320s

i’ve run the trail in the postgresql and i get:
2020-06-30_10:40:08.30556 FATAL: database files are incompatible with server
2020-06-30_10:40:08.30557 DETAIL: The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.7.
2020-06-30_10:40:09.31190 FATAL: database files are incompatible with server
2020-06-30_10:40:09.31192 DETAIL: The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.7.
2020-06-30_10:40:10.31792 FATAL: database files are incompatible with server
2020-06-30_10:40:10.31793 DETAIL: The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.7.
2020-06-30_10:40:11.32462 FATAL: database files are incompatible with server
2020-06-30_10:40:11.32463 DETAIL: The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.7.
2020-06-30_10:40:12.33073 FATAL: database files are incompatible with server
2020-06-30_10:40:12.33074 DETAIL: The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.7.
2020-06-30_10:40:13.33719 FATAL: database files are incompatible with server
2020-06-30_10:40:13.33721 DETAIL: The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.7.
2020-06-30_10:40:14.34294 FATAL: database files are incompatible with server
2020-06-30_10:40:14.34296 DETAIL: The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.7.
^CTraceback (most recent call last):
5: from /opt/gitlab/embedded/bin/omnibus-ctl:23:in <main>' 4: from /opt/gitlab/embedded/bin/omnibus-ctl:23:in load’
3: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/bin/omnibus-ctl:31:in <top (required)>' 2: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:746:in run’
1: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:584:in tail' /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:584:in system’: Interrupt

I’ve checked my data directory of the packaged postgresql and i have both the folder data and data.9.6

How can i fix this?
Thanks in advance for any input

You’ve taken too big a step. PostgreSQL 11 wasn’t supported in 12.7 yet, but was the minimum required version for 13, and the upgrade had to happen before. I believe I’ve read somewhere that the genereal recommendation is to upgrade to the latest version in the 12 series first (that will be 12.10.13). Unless you have a flag file present in /etc/gitlab (sorry I don’t remember the name), the upgrade til 12.10 should upgrade you database.

I have no idea how to fix it if you can’t go back to a working setup, but you can try sudo gitlab-ctl pg-upgrade, that shouldn’t harm anything at least.