J’ai réussi ma migration vers la 3.0. Cependant, lorsque j’essaie d’accomplir la dernière migration "postgresql 9p4 to 9p6 ", j’ai un message d’erreur :
Migration 5 postgresql_9p4_to_9p6 has failed with exception Command ‘pg_dropcluster --stop 9.6 main’ returned non-zero exit status 1, aborting
Quelqu’un a-t-il une idée ? Tout a l’air pourtant de très bien fonctionner !
Ce problème s’est résolu un peu par hasard ; je dois l’avouer…
J’ai désactivé certaines sources dans apt, qui renvoyaient vers la version 8 - après, si je me rappelle bien, cela s’est débloqué…
deb http://ftp.fr.debian.org/debian/ stretch main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ stretch main contrib non-free
#Security
deb http://security.debian.org/ stretch/updates main contrib non-free
deb-src http://security.debian.org/ stretch/updates main contrib non-free
#Backports
#deb http://ftp.debian.org/debian/ jessie-backports main contrib non-free
Sinon j’ai un fichier/etc/apt/sources.list.d/jessie-backports.list (mais aussi avec un hashtag devant) :
#deb http://httpredir.debian.org/debian jessie-backports main
Y a t il d’autre endroit où je n’aurais pas regardé ?
sudo pg_upgradecluster -m upgrade 9.4 main
Stopping old cluster...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for stop operation
Creating new cluster 9.6/main ...
config /etc/postgresql/9.6/main
data /var/lib/postgresql/9.6/main
locale en_US.UTF-8
socket /var/run/postgresql
port 5433
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is the install user ok
Checking database connection settings ok
Checking for prepared transactions ok
Checking for reg* system OID user data types ok
Checking for contrib/isn with bigint-passing mismatch ok
Checking for roles starting with 'pg_' ok
Creating dump of global objects ok
Creating dump of database schemas
ok
Checking for presence of required libraries ok
Checking database user is the install user ok
Checking for prepared transactions ok
If pg_upgrade fails after this point, you must re-initdb the
new cluster before continuing.
Performing Upgrade
------------------
Analyzing all rows in the new cluster ok
Freezing all rows on the new cluster ok
Deleting files from new pg_clog ok
Copying old pg_clog to new server ok
Setting next transaction ID and epoch for new cluster ok
Deleting files from new pg_multixact/offsets ok
Copying old pg_multixact/offsets to new server ok
Deleting files from new pg_multixact/members ok
Copying old pg_multixact/members to new server ok
Setting next multixact ID and offset for new cluster ok
Resetting WAL archives ok
Setting frozenxid and minmxid counters in new cluster ok
Restoring global objects in the new cluster ok
Restoring database schemas in the new cluster
ok
Copying user relation files
ok
Setting next OID for new cluster ok
Sync data directory to disk ok
Creating script to analyze new cluster ok
Creating script to delete old cluster ok
Upgrade Complete
----------------
Optimizer statistics are not transferred by pg_upgrade so,
once you start the new server, consider running:
./analyze_new_cluster.sh
Running this script will delete the old cluster's data files:
./delete_old_cluster.sh
pg_upgrade output scripts are in /var/log/postgresql/pg_upgradecluster-9.4-9.6-main.PY10
Copying old configuration files...
Copying old start.conf...
Copying old pg_ctl.conf...
Disabling automatic startup of old cluster...
Configuring old cluster to use a different port (5433)...
Starting target cluster on the original port...
Redirecting start request to systemctl
Success. Please check that the upgraded cluster works. If it does,
you can remove the old cluster with
pg_dropcluster 9.4 main
Vérification,
pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
9.4 main 5433 down postgres /var/lib/postgresql/9.4/main /var/log/postgresql/postgresql-9.4-main.log
9.6 main 5432 online postgres /var/lib/postgresql/9.6/main /var/log/postgresql/postgresql-9.6-main.log
Je ne pourrai plus te répondre précisément ; j’avais réalisé cette opération sur un Odroid C2 à des fins de test. Il suffit que tu compares les lignes et enlèves celles qui ne correspondent pas à Stretch.
Cela arrive tard (et peut-être la solution est-elle décrite autre part sur le forum), mais si jamais quelqu’un tombe sur ce souci, voici comment je l’ai résolu de mon côté.
Comme l’erreur était qu’il ne trouvait pas de cluster en version 9.6 qui s’appelait main (quand on fait tourner pg_dropcluster --stop 9.6 main manuellement, on reçoit l’erreur “Error: specified cluster does not exist”), j’ai simplement créé le cluster en question: pg_createcluster 9.6 main
Après quoi, la migration est passée crème (avec un peu de patience).