We/I began a long-term plan that includes migrating our remaining Plone 5 sites to Plone 6.
I found that modifying the Plone 5 buildout to pull in version 6.0.11 worked, I was able to run the migration and successfully update my ZODB.
I then modified the buildout to add relstorage into the mix so that I could run zodbconvert. Once relstorage and utils were installed I created a zodbconvert.conf file like the following (I need to convert encrypted dataFS to unencrypted relstorage).
FWIW: I am using Postgres 16 in a cluster formation of 3 machines: 1 main 1 replica and 1 hot spare. Also Python 3.10.15
%import cipher.encryptingstorage
<encryptingstorage source>
config /opt/plone52x/zeocluster/encryption.conf
# FileStorage database
<filestorage>
path /opt/plone52x/zeocluster/var/filestorage/encrypted.fs
blob-dir /opt/plone52x/zeocluster/var/blobstorage-enc/
</filestorage>
</encryptingstorage>
<relstorage destination>
keep-history false
shared-blob-dir false
blob-dir /opt/plone52x/zeocluster/var/blob-cache
blob-cache-size 768mb
<postgresql>
dsn dbname='psqlDB4' host='172.16.140.100' port='5000' user='plone' password=''XXXXXXX"
</postgresql>
</relstorage>
When I run --dry-run there are no complaints from zodbconvert.
When I run zodbconvert for real I use the --clear and --trace flags. FYI - It took about 21hours to transfer 520gb to the new database.
Once zodbconvert is done, I try to run the instance to test the conversion, both relstorage & psycopg2 complain:
psycopg2.errors.InvalidForeignKey: there is no unique constraint matching given keys for referenced table "object_state"
2024-09-27 12:45:02,305 WARNING [relstorage.adapters.scriptrunner:84][MainThread] script statement failed: 'CREATE TABLE current_object (\nzoid BIGINT NOT NULL PRIMARY KEY,\ntid BIGINT NOT NULL,\nFOREIGN KEY (zoid, tid)\nREFERENCES object_state (zoid, tid)\n) '; parameters: ()
I must be doing something wrong as I cannot seem to find any examples of anyone else having these issues. I've been working too long and too close to this that any new eyes on this would be welcome.
my PostgreSQL logs have an error for the DB:
2024-09-27 16:58:03 UTC [991261-5] [local] plone@psqlDB4 ERROR: there is no unique constraint matching given keys for referenced table "object_state" 2024-09-27 16:58:03 UTC [991261-6] [local] plone@psqlDB4 STATEMENT: CREATE TABLE current_object ( zoid BIGINT NOT NULL PRIMARY KEY, tid BIGINT NOT NULL, FOREIGN KEY (zoid, tid) REFERENCES object_state (zoid, tid) )
I've been able to validate that my relstorage works with a new site. Plone can create the proper schema in a new PSQL table fine. Something is off with my conversion process. Any ideas are welcome. --thanks!