Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgresql issue when trying to upgrade from 1.10.18 to either 2.0.0 or 2.1.6 #19368

Closed
daledude opened this issue Sep 16, 2023 · 3 comments
Closed

Comments

@daledude
Copy link

PS. if there a faster way to get to 2.9.0 from 1.10.18 while keeping my data, even with a reinstall or whatever, I'm all ears :)

Ubuntu 16.04.7 LTS
Docker version 20.10.7, build f0df350

I keep getting an error in the harbor-db container after the install.sh and the containers are running except harbor-db which keeps restarting. btw, I use LDAP for auth.

I do run the prepare migrate and it succeeds:

docker run -it --rm -v /:/hostfs goharbor/prepare:v2.1.6 migrate -i /root/harbor/harbor/harbor.yml
migrating to version 2.0.0
migrating to version 2.1.0
Written new values to /root/harbor/harbor/harbor.yml

/docker-pool/database/pg13/PG_VERSION contains the number 13.

docker logs on harbor-db shows:
initdb: directory "/var/lib/postgresql/data" exists but is not empty

I mv the contents of /docker-pool/database/pg13/ to /docker-pool/database/ and removed pg13 directory. That produced this error:
/var/lib/postgresql/data" is not a valid data directory

If I empty the database directory it will create a new empty data and of course all my stuff is gone.

My file permissions are fine. Below is from host and "docker" is id 999. I did try privileged but I don't believe it has to do with permissions.

ls -l /docker-pool/
drwxr-xr-x  2 10000  10000       2 Mar 10  2018 ca_download
drwxr-xr-x  2 10000  10000       2 Aug 23  2018 chart_storage
drwx------ 19   999 docker      25 Aug 23  2018 clair-db
drwxr-xr-x  2 10000  10000       2 Mar 10  2018 config
drwx------  3   999 docker       3 Sep 15 22:28 database
drwxr-xr-x  3 10000  10000      69 Sep 16 00:08 job_logs
drwxr-xr-x  6 10000  10000      13 Aug 23  2018 notary-db
drwxr-xr-x  2 10000  10000       2 Mar 10  2018 psc
drwxr-xr-x  2   999 docker       3 Sep 16 00:10 redis
drwxr-xr-x  3 10000  10000       4 Oct 25  2019 registry
drwxr-xr-x  7 root  root         7 Sep 16 00:12 secret
drwxr-xr-x  4 root  root         4 Sep 16 00:08 trivy-adapter

ls -l /docker-pool/database/pg13/
drwx------ 8 999 docker     8 Sep 15 22:28 base
drwx------ 2 999 docker    60 Sep 16 00:13 global
drwx------ 2 999 docker     2 Sep 15 22:28 pg_commit_ts
drwx------ 2 999 docker     2 Sep 15 22:28 pg_dynshmem
-rw------- 1 999 docker  4490 Sep 15 22:28 pg_hba.conf
-rw------- 1 999 docker  1636 Sep 15 22:28 pg_ident.conf
drwx------ 4 999 docker     5 Sep 15 22:35 pg_logical
drwx------ 4 999 docker     4 Sep 15 22:28 pg_multixact
drwx------ 2 999 docker     2 Sep 15 22:28 pg_notify
drwx------ 2 999 docker     2 Sep 15 22:28 pg_replslot
drwx------ 2 999 docker     2 Sep 15 22:28 pg_serial
drwx------ 2 999 docker     2 Sep 15 22:28 pg_snapshots
drwx------ 2 999 docker     2 Sep 16 00:12 pg_stat
drwx------ 2 999 docker    10 Sep 16 00:15 pg_stat_tmp
drwx------ 2 999 docker     4 Sep 15 22:28 pg_subtrans
drwx------ 2 999 docker     2 Sep 15 22:28 pg_tblspc
drwx------ 2 999 docker     2 Sep 15 22:28 pg_twophase
-rw------- 1 999 docker     3 Sep 15 22:28 PG_VERSION
drwx------ 3 999 docker     4 Sep 15 22:28 pg_wal
drwx------ 2 999 docker   193 Sep 15 22:28 pg_xact
-rw------- 1 999 docker    88 Sep 15 22:28 postgresql.auto.conf
-rw------- 1 999 docker 27960 Sep 15 22:28 postgresql.conf
-rw------- 1 999 docker    92 Sep 16 00:12 postmaster.opts
-rw------- 1 999 docker    95 Sep 16 00:12 postmaster.pid
@stonezdj
Copy link
Contributor

1.10.x -> 2.1.x -> 2.3.x -> 2.5.x -> 2.7.x -> 2.9.x

@YangJiao0817
Copy link
Member

@daledude You can refer to this release notes to upgrade to v2.3.x first.
1.10.18 -> 2.3.x -> 2.5.x -> 2.7.x -> 2.9.x

@daledude
Copy link
Author

Thanks @YangJiao0817 . I didn't see those when I was searching and the info looks useful. I ended up just installing a fresh 2.9 then migrating everything using skopeo. Only had 25 projects an ~200 images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants