Re: pg_upgrade -c cannot be run if old cluster is running

2024-09-05 Thread Tom Lane
Alain Bourgeois writes: > When the cluster was created, we did initdb /var/lib/pgsql10/data, the > storagebox was not available. > Then storagebox was delivered, we copied data folder to storagebox in > /mnt/pgdata/pgdir and changed postgresql.conf. We didn't delete existing > datafiles from /

RE: pg_upgrade -c cannot be run if old cluster is running

2024-09-05 Thread Alain Bourgeois
When the cluster was created, we did initdb /var/lib/pgsql10/data, the storagebox was not available. Then storagebox was delivered, we copied data folder to storagebox in /mnt/pgdata/pgdir and changed postgresql.conf. We didn't delete existing datafiles from /var/lib/pgsql10/data (db was empty)

Re: pg_upgrade -c cannot be run if old cluster is running

2024-09-05 Thread Tom Lane
[ Please keep the mailing list cc'd ] Alain Bourgeois writes: > I confirm copyig config to data dir and specifying data dir works > /usr/pgsql-15/bin/pg_upgrade --check -b /usr/pgsql-10/bin/ -B > /usr/pgsql-15/bin -d /mnt/pgdata/pgdir -D /mnt/pgdata/pgdirbc15 --check Hm. On second look, there

Re: pg_upgrade -c cannot be run if old cluster is running

2024-09-05 Thread Daniel Gustafsson
> On 5 Sep 2024, at 15:39, Tom Lane wrote: > > Alain Bourgeois writes: >> /usr/lib/systemd/system/postgresql-10.service has >> PGDATA=/var/lib/pgsql/10/data/, /var/lib/pgsql/10/data/postgtresql.conf >> holds data_directory = '/mnt/pgdata/pgdir' > > This is probably the source of your problem.

Re: pg_upgrade -c cannot be run if old cluster is running

2024-09-05 Thread Tom Lane
Alain Bourgeois writes: > /usr/lib/systemd/system/postgresql-10.service has > PGDATA=/var/lib/pgsql/10/data/, /var/lib/pgsql/10/data/postgtresql.conf holds > data_directory = '/mnt/pgdata/pgdir' This is probably the source of your problem. IIRC, pg_upgrade needs to be pointed at the actual old

RE: pg_upgrade -c cannot be run if old cluster is running

2024-09-05 Thread Alain Bourgeois
Tried (as postgres) /usr/pgsql-15/bin/pg_upgrade --check -b /usr/pgsql-10/bin/ -B /usr/pgsql-15/bin -d /var/lib/pgsql/10/data -D /mnt/pgdata/pgdirbc15 -p5432 -P5455 -Upostgres -v Running in verbose mode Performing Consistency Checks - Checking cluster versions

RE: pg_upgrade -c cannot be run if old cluster is running

2024-09-05 Thread Alain Bourgeois
Here is what can be said about config (no extension, nothing special) There are already one postgresql-15 services (separate cluster, on ports <>5432) that run on this machine, and there is also one postgres 10 cluster (on port 5432). The aim is to update the 10 to 15 to get rid of v10. So we cre

Re: pg_upgrade -c cannot be run if old cluster is running

2024-09-04 Thread Tom Lane
PG Doc comments form writes: > https://www.postgresql.org/docs/15/pgupgrade.html tells > "You can use pg_upgrade --check to perform only the checks, even if the old > server is still running." I tested this case, and it seems to work for me. pg_upgrade will try to start a server in the old data