I tested collective.exportimport on a project where we are planning/have almost done an inplace migration for the content from Plone 4 to Plone 5.X . This particular site has been upgraded from Plone 2.X up and up. With trying to get the inplace migration working small exceptions/leftsover component-registration, broken items, etc. surfaced, hence my spike to test this route.
With limited testing collective.exportimport shows great potential, I'm already restoring some content, but I have run into some issues of which I'm not sure if these are generic enough to add to the add'on or are edge cases to override in my own export/import class as suggested in the README.
First: the import/exports are all using pone.restapi's (de)serializers and I think there are some small differences between the AT and DX ones.
The description field on some content items is from plone.restapi in Plone 4 exported as:
"description": { "content-type": "text/plain", "data": "some text" },
where in Plone 5DX this is exported as
"description": "text"
But Plone 5.2 is restapi deserializer/importer complains about the (sub) object this with a WrongType without any hints. So after this I first continued testing export and import from & to Plone 4, then this doesn't show up.
I have to dig further if this is indeed a difference between the AT/DX serializers.
Then I found out this Plone 4 site has some content id's with spaces: this%20is%20my%20id, aka url encoded. I patched the exporter to search/replace the id and then export the folders. This could go in a global_dict_hook()
But I'm running into a related issue some steps later when I start importing my exported Documents/pages and the relatedItems restore crashes on relations to other items also with %20's in the id's in Archetypes ReferenceEngine. But this could become be a non issue in the end because I don't want to restore content to Plone 4/AT site, but in a Plone5.2/DX.
"relatedItems": [ "http://localhost:9050/plone/path/to/something/with/url%20encodes.doc",
I think it is best in this case to first 'fix' all id's with %20 in the Plone 4 site before starting any migration.
Then in the Plone 4 site the ModifiedDates have a different (invalid/custom?) timezone component that has "+01:00" as a UTC time offset, where %z in collective.exportimport its:
datetime.strptime(modified, "%Y-%m-%dT%H:%M:%S%z")
only seems to work correctly in Python3 according to online resources, but still doesn't like the ":" and the full string date should be u'2011-10-13T13:49:57+0100', not u'2011-10-13T13:49:57+00:00'
from dateutil import parse
parser.parse(modified)
as per Stack Overflow search/copy/paste solves the invalid %z traceback
So for the few hours I spend on this, this looks very promising for less painful small to medium site migrations with mostly default content. . You don't know beforehand what's lurking in pickles in your ZODB from 10-15 years of a site its existence. And you get also very quick round trip on where the issues are when you do an export/import.
The only exception on clear feedback so far being the description problem where these lines in the DX deserializer in plone.restapi hide the real Python exception. Maybe nice for frontends but not for migrations :-/