Installing plone.app.contenttypes, migrating from Archetypes to Dexterity

I want to migrate existing Archetype content to Dexterity in a Plone 4.3.6 installation.

I added
plone.app.dexterity
plone.app.contenttypes
Products.contentmigration

Version pin plone.app.contenttypes = 1.1b5

While running buildout the following error occur:

Installing instance.
The constraint, 0.7.7, is not consistent with the requirement, 'plone.app.z3cform>=2.0.1.dev0'.
While:
Installing instance.
Error: Bad constraint 0.7.7 plone.app.z3cform>=2.0.1.dev0

How can I install plone.app.contenttypes and migrate content to Dexterity in Plone 4.3.6?

First, I would use the newest version of 1.1 which is 1.1.5 :wink:
Then try to pin plone.app.z3cform in your buildout config. The message means that the package has a different pinning than the requirement needs. You can override this by pinning it to the requested version or even higher if possible. Check the notes on the pypi page of the package for the possible version for your Plone version.

I pinned plone.app.contenttypes = 1.1.5

This still ends up in
Error: Bad constraint 0.7.7 plone.app.z3cform>=2.0.1.dev0

Then I pinned
plone.app.z3cform = 2.0.1.dev0

this ends up in
Error: Couldn't find a distribution for 'plone.app.z3cform==2.0.1.dev0

Then I pinned
plone.app.z3cform = 2.1

This ends up in
Error: Bad constraint 2.3.13 plone.app.layout>=2.5.22,!=2.6.0,!=2.6.1,!=2.6.2

When I pin plone.app.layout to 2.5.22 it says I need Plone 5

How can I get this working?

The best way is, to look up first where the requirements are comming from:

Version and requirements information containing plone.app.z3cform:
  [versions] constraint on plone.app.z3cform: 0.7.7
  Requirement of plone.app.dexterity<2.1.0: plone.app.z3cform>=0.7.2
  Requirement of plone.app.event[dexterity]: plone.app.z3cform>=2.0.1.dev0
  Requirement of plone.app.caching: plone.app.z3cform
  Requirement of plone.app.dexterity[relations]: plone.app.z3cform>=0.7.2
  Requirement of plone.app.registry>=1.1dev: plone.app.z3cform
  Requirement of plone.app.z3cform>=0.7.2: zope.traversing
  Requirement of plone.app.z3cform>=0.7.2: zope.interface
  Requirement of plone.app.z3cform>=0.7.2: zope.component
  Requirement of plone.app.z3cform>=0.7.2: zope.browserpage
  Requirement of plone.app.z3cform>=0.7.2: Zope2
  Requirement of plone.app.z3cform>=0.7.2: z3c.formwidget.query
  Requirement of plone.app.z3cform>=0.7.2: plone.protect
  Requirement of plone.app.z3cform>=0.7.2: plone.z3cform>=0.5.11dev
  Requirement of plone.app.z3cform>=0.7.2: z3c.form>=3.0
  Requirement of plone.app.z3cform>=0.7.2: collective.z3cform.datetimewidget>=0.1a2
  Requirement of plone.app.z3cform>=0.7.2: setuptools
While:
  Installing instance.
Error: The requirement ('plone.app.z3cform>=2.0.1.dev0') is not allowed by your [versions] constraint (0.7.7)

As you can see, it's the plone.app.event packages which requires the newer version here.
So lets try an older one. In the readme of plone.app.contenttype you can find a list of pinnings for older Plone version like 4.3.4 which helps here to find the right version of plone.app.event. It says 1.1.4 and the newest version in that series is 1.1.11 so I would try that.

I also pinned the following versions:

  • plone.app.event = 1.1.11
  • plone.formwidget.recurrence = 1.2.6
  • plone.app.locales = 4.3.9
  • Products.PloneFormGen = 1.7.23

Okay, with your version pinning I got plone.app.contentypes installed via buildout, thank you!
Now when I try to install it in my Plone instance via polone_control_panel I get the following error:

Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 593, in installProducts
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 521, in installProduct

  • traceback_info: ('plone.app.contenttypes',)
    Module Products.GenericSetup.tool, line 365, in runAllImportStepsFromProfile
  • traceback_info: profile-plone.app.contenttypes:default
    Module Products.GenericSetup.tool, line 1119, in _runImportStepsFromContext
    Module Products.GenericSetup.tool, line 1030, in _doRunImportStep
  • traceback_info: plone.app.contenttypes
    Module plone.app.contenttypes.setuphandlers, line 404, in step_setup_various
    Module plone.app.contenttypes.setuphandlers, line 113, in _get_locales_info
    Module zope.i18n.locales.provider, line 76, in getLocale
    Module zope.i18n.locales.provider, line 55, in loadLocale
    LoadLocaleError: The desired locale is not available.
    Path: /plone/mysite/buildout-cache/eggs/zope.i18n-3.7.4-py2.7.egg/zope/i18n/locales/data/.xml

well, this change has undone you.

I don't know if some install step is supposed to add back to Plone 4 the plone.default_language registry entry that is now the official method to get the site language.
It could be possible to patch the registry but is it just getting you deeper in the mire I don't know. Maybe there is a cleaner way.

What does this mean @gp54321 ?

Does it mean that plone.app.contentypes is not compatible to Plone 4, while documentation says it is?

By the way, I migrated my Plone site to Plone 5.08 which works fine.
But when I than start to migrate Archetypes to Dexterity I get key errors while migrating folders. (its a plain plone site, no custum archetypes)
So in the end I don't know how to migrate my content to dexterity as ist doesn't work in Plone 4 nor in Plone 5 :frowning:

Traceback (innermost last):

    Module ZPublisher.Publish, line 138, in publish
    Module ZPublisher.mapply, line 77, in mapply
    Module ZPublisher.Publish, line 48, in call_object
    Module z3c.form.form, line 233, in __call__
    Module z3c.form.form, line 228, in update
    Module plone.app.z3cform.csrf, line 21, in execute
    Module z3c.form.action, line 98, in execute
    Module z3c.form.button, line 315, in __call__
    Module z3c.form.button, line 170, in __call__
    Module plone.app.contenttypes.migration.browser, line 397, in handle_migrate
    Module plone.app.contenttypes.migration.browser, line 223, in __call__
    Module plone.app.contenttypes.migration.migration, line 347, in migrate_folders
    Module plone.app.contenttypes.migration.migration, line 50, in migrate
    Module Products.contentmigration.basemigrator.walker, line 144, in go
    Module Products.contentmigration.basemigrator.walker, line 223, in migrate

MigrationError: MigrationError for obj at /myPlone/myFolder (Folder -> Folder):
Traceback (most recent call last):
  File "/plone/myPloneSite/buildout-cache/eggs/Products.contentmigration-2.1.16-py2.7.egg/Products/contentmigration/basemigrator/walker.py", line 192, in migrate
    migrator.migrate()
  File "/plone/myPloneSite/buildout-cache/eggs/Products.contentmigration-2.1.16-py2.7.egg/Products/contentmigration/basemigrator/migrator.py", line 214, in migrate
    self.renameOld()
  File "/plone/myPloneSite/buildout-cache/eggs/Products.contentmigration-2.1.16-py2.7.egg/Products/contentmigration/basemigrator/migrator.py", line 481, in renameOld
    unrestricted_rename(self.parent, self.orig_id, self.old_id)
  File "/plone/myPloneSite/buildout-cache/eggs/Products.contentmigration-2.1.16-py2.7.egg/Products/contentmigration/common.py", line 110, in unrestricted_rename
    self._delObject(id)
  File "/plone/myPloneSite/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/OFS/ObjectManager.py", line 407, in _delObject
    notify(ObjectRemovedEvent(ob, self, id))
  File "/plone/myPloneSite/buildout-cache/eggs/zope.event-3.5.2-py2.7.egg/zope/event/__init__.py", line 31, in notify
    subscriber(event)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/event.py", line 24, in dispatch
    zope.component.subscribers(event, None)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 136, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/registry.py", line 321, in subscribers
    return self.adapters.subscribers(objects, provided)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.interface-3.6.7-py2.7-linux-x86_64.egg/zope/interface/adapter.py", line 585, in subscribers
    subscription(*objects)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/event.py", line 32, in objectEventNotify
    zope.component.subscribers((event.object, event), None)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 136, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/registry.py", line 321, in subscribers
    return self.adapters.subscribers(objects, provided)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.interface-3.6.7-py2.7-linux-x86_64.egg/zope/interface/adapter.py", line 585, in subscribers
    subscription(*objects)
  File "/plone/myPloneSite/buildout-cache/eggs/five.intid-1.1.2-py2.7.egg/five/intid/intid.py", line 127, in removeIntIdSubscriber
    notify(IntIdRemovedEvent(ob, event))
  File "/plone/myPloneSite/buildout-cache/eggs/zope.event-3.5.2-py2.7.egg/zope/event/__init__.py", line 31, in notify
    subscriber(event)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/event.py", line 24, in dispatch
    zope.component.subscribers(event, None)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 136, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/registry.py", line 321, in subscribers
    return self.adapters.subscribers(objects, provided)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.interface-3.6.7-py2.7-linux-x86_64.egg/zope/interface/adapter.py", line 585, in subscribers
    subscription(*objects)
  File "/plone/myPloneSite/buildout-cache/eggs/z3c.relationfield-0.7-py2.7.egg/z3c/relationfield/event.py", line 105, in breakRelations
    notify(ObjectModifiedEvent(rel.from_object))
  File "/plone/myPloneSite/buildout-cache/eggs/zope.event-3.5.2-py2.7.egg/zope/event/__init__.py", line 31, in notify
    subscriber(event)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/event.py", line 24, in dispatch
    zope.component.subscribers(event, None)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 136, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/registry.py", line 321, in subscribers
    return self.adapters.subscribers(objects, provided)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.interface-3.6.7-py2.7-linux-x86_64.egg/zope/interface/adapter.py", line 585, in subscribers
    subscription(*objects)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/event.py", line 32, in objectEventNotify
    zope.component.subscribers((event.object, event), None)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 136, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.component-3.9.5-py2.7.egg/zope/component/registry.py", line 321, in subscribers
    return self.adapters.subscribers(objects, provided)
  File "/plone/myPloneSite/buildout-cache/eggs/zope.interface-3.6.7-py2.7-linux-x86_64.egg/zope/interface/adapter.py", line 585, in subscribers
    subscription(*objects)
  File "/plone/myPloneSite/buildout-cache/eggs/plone.app.linkintegrity-3.1-py2.7.egg/plone/app/linkintegrity/handlers.py", line 109, in modifiedContent
    links = retriever.retrieveLinks()
  File "/plone/myPloneSite/buildout-cache/eggs/plone.app.linkintegrity-3.1-py2.7.egg/plone/app/linkintegrity/retriever.py", line 35, in retrieveLinks
    value = accessor()
  File "/plone/myPloneSite/buildout-cache/eggs/Products.Archetypes-1.10.18-py2.7.egg/Products/Archetypes/ClassGen.py", line 57, in generatedAccessor
    return schema[name].get(self, **kw)
  File "/plone/myPloneSite/buildout-cache/eggs/Products.Archetypes-1.10.18-py2.7.egg/Products/Archetypes/Field.py", line 1565, in get
    encoding=kwargs.get('encoding', None))
  File "/plone/myPloneSite/buildout-cache/eggs/Products.Archetypes-1.10.18-py2.7.egg/Products/Archetypes/BaseUnit.py", line 102, in transform
    filename=self.filename)
  File "/plone/myPloneSite/buildout-cache/eggs/Products.PortalTransforms-2.2.1-py2.7.egg/Products/PortalTransforms/TransformEngine.py", line 171, in convertTo
    usedby=usedby, **kwargs)
  File "/plone/myPloneSite/buildout-cache/eggs/Products.PortalTransforms-2.2.1-py2.7.egg/Products/PortalTransforms/chain.py", line 51, in convert
    data = transform.convert(orig, data, **kwargs)
  File "/plone/myPloneSite/buildout-cache/eggs/Products.PortalTransforms-2.2.1-py2.7.egg/Products/PortalTransforms/Transform.py", line 196, in convert
    return self._v_transform.convert(*args, **kwargs)
  File "/plone/myPloneSite/buildout-cache/eggs/plone.outputfilters-3.0.1-py2.7.egg/plone/outputfilters/transforms/html_to_plone_outputfilters_html.py", line 33, in convert
    res = apply_filters(filters, orig)
  File "/plone/myPloneSite/buildout-cache/eggs/plone.outputfilters-3.0.1-py2.7.egg/plone/outputfilters/__init__.py", line 7, in apply_filters
    res = filter(data)
  File "/plone/myPloneSite/buildout-cache/eggs/plone.outputfilters-3.0.1-py2.7.egg/plone/outputfilters/filters/resolveuid_and_caption.py", line 117, in __call__
    self.feed(data)
  File "/usr/lib/python2.7/sgmllib.py", line 104, in feed
    self.goahead(0)
  File "/usr/lib/python2.7/sgmllib.py", line 138, in goahead
    k = self.parse_starttag(i)
  File "/usr/lib/python2.7/sgmllib.py", line 296, in parse_starttag
    self.finish_starttag(tag, attrs)
  File "/usr/lib/python2.7/sgmllib.py", line 338, in finish_starttag
    self.unknown_starttag(tag, attrs)
  File "/plone/myPloneSite/buildout-cache/eggs/plone.outputfilters-3.0.1-py2.7.egg/plone/outputfilters/filters/resolveuid_and_caption.py", line 340, in unknown_starttag
    obj, subpath, appendix = self.resolve_link(href)
  File "/plone/myPloneSite/buildout-cache/eggs/plone.outputfilters-3.0.1-py2.7.egg/plone/outputfilters/filters/resolveuid_and_caption.py", line 178, in resolve_link
    obj = self.lookup_uid(uid)
  File "/plone/myPloneSite/buildout-cache/eggs/plone.outputfilters-3.0.1-py2.7.egg/plone/outputfilters/filters/resolveuid_and_caption.py", line 162, in lookup_uid
    return uuidToObject(uid)
  File "/plone/myPloneSite/buildout-cache/eggs/plone.outputfilters-3.0.1-py2.7.egg/plone/outputfilters/browser/resolveuid.py", line 31, in uuidToObject
    return res[0]._unrestrictedGetObject()
  File "/plone/myPloneSite/buildout-cache/eggs/Products.ZCatalog-3.0.2-py2.7.egg/Products/ZCatalog/CatalogBrains.py", line 80, in _unrestrictedGetObject
    return parent.unrestrictedTraverse(self.getPath())
  File "/plone/myPloneSite/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/OFS/Traversable.py", line 300, in unrestrictedTraverse
    raise e
KeyError: 'myFolder'

Does that folder exist?

here is the last passing test for plone.app.content:
test 2 feb 2015

while the change I showed you was committed one month later.

This said, I have not looked up if the automated tests could have caught this particular problem, but anyway since they have not run successfully since this date for this particular version of plone.app.contenttypes, this is a working hypothesis at least.

You could try to change the code yourself in your Plone 4.3 instance and see if it works if yes file an issue.
About Plone 5 I think I have seen somewhere it was safer to migrate while on Plone 4 but I am not sure. As I have never even tried to use Archetypes I am not well placed to give you the best advice.

:slight_smile:
Of course does this folder exist.
And if I delete it -just for testing- I get the key error on "myNextFolder"

Can we see your buildout.cfg?

It is very strange that unrestrictedTraverse doesn't 'see' the object.

I don't know what you mean in any detail - I am no developer, just using Plone.

You said :"it was safer to migrate while on Plone 4 but I am not sure" - well, thats why I wanted to convert to Dexterity in Plone 4 - and I opened this topic because that is not possible although I've read the documentation and did it as described.

So I now have my migrated Plone Site in version 5 with no Dexterity. (key error as described above on migration)
And I have my Plone 4.3 site that I cannot migrate from archetypes to dexterity because I cannot install plone.app.contentypes.

I am at a loss. :frowning:

Sure.

It's the standard buildout after using the unifiedinstaller on Linux.

Just added some addons in [eggs] and changing the port, no further changes.

But I can post it if you like.

Buildout Plone 5.08 -> Migration from Archetypes to Dexterity not working (exception posted above)

[buildout]
############################################
# Plone Component Versions

extends =
    base.cfg
    versions.cfg
#    http://dist.plone.org/release/5.0.8/versions.cfg

find-links +=
    http://dist.plone.org/release/5.0.8


index = https://pypi.python.org/simple/

effective-user = plone_daemon

buildout-user = plone_buildout

need-sudo = yes

extensions = buildout.wheel

############################################
# Eggs

eggs =
    Plone
    Pillow

    Products.PloneHotfix20171128
    collective.plonetruegallery
    collective.ptg.highslide
    collective.ptg.fancybox
    collective.ptg.galleriffic
    collective.ptg.s3slider
    collective.ptg.pikachoose
    collective.ptg.nivoslider
    collective.ptg.nivogallery
    collective.ptg.contentflow
    collective.ptg.supersized
    collective.ptg.thumbnailzoom
    collective.ptg.contactsheet
    collective.prettyphoto
    collective.newsticker
    collective.portlet.twitter   
    plone.app.mosaic
    collective.js.datatables
    Products.PloneFormGen
    collective.tiles.sliders
    collective.disqus
############################################
# ZCML Slugs
# ----------
zcml =
#    plone.reload

############################################
# Development Eggs

# Provide the *paths* to the eggs you are developing here:
develop =
#    src/my.package

############################################
# var Directory

var-dir=${buildout:directory}/var

############################################
# Backup Directory

backups-dir=${buildout:var-dir}

############################################
# Initial User

user=admin:1234

############################################
# Debug Options

deprecation-warnings = off
verbose-security = off

############################################
# Parts Specification

parts =
    instance
    repozo
    backup
    zopepy
    unifiedinstaller
    precompiler
    setpermissions
############################################
# Major Parts
[instance]
<= instance_base
recipe = plone.recipe.zope2instance
http-address = 7865


############################################
# Versions Specification
[versions]
# Use the setuptools and zc.buildout versions that are
# available in our Python environment.
setuptools =
zc.buildout =

Pillow = 3.4.2

Products.DocFinderTab = 1.0.5
Products.PloneHotfix20160830 = 1.3
Products.PloneHotfix20161129 = 1.2
bobtemplates.plone = 1.0.5
buildout.sanitycheck = 1.0.2
collective.checkdocs = 0.2
collective.recipe.backup = 3.0.0
mr.bob = 0.1.2
pkginfo = 1.4.1
plone.recipe.unifiedinstaller = 4.3.2
requests-toolbelt = 0.7.0
zest.pocompile = 1.4

# Required by:
# Jinja2==2.8
MarkupSafe = 0.23

# Required by:
# clint==0.5.1
args = 0.1.0

# Required by:
# twine==1.8.1
clint = 0.5.1

# Required by:
# zest.releaser==6.8
colorama = 0.3.7




.PloneHotfix20171128 = 1.0

plone.tiles = 1.8.3
plone.subrequest = 1.8.1
plone.app.tiles = 3.0.3
plone.app.standardtiles = 2.2.0
plone.app.blocks = 4.1.1
plone.app.drafts = 1.1.2
plone.app.mosaic = 2.0rc8
plone.formwidget.multifile = 2.0
plone.jsonserializer = 0.9.5
Products.PloneFormGen = 1.8.5
collective.js.datatables = 4.1.2
collective.portlet.twitter = 1.0rc1
collective.prettyphoto = 0.6
collective.newsticker = 2.1b1
Products.PloneFormGen = 1.8.5
collective.disqus = 2.1
collective.plonetruegallery = 3.4.8
collective.tiles.sliders = 0.4

as I said try to replace in
plone/app/contenttypes/setuphandlers.py

def _get_locales_info(portal):
reg = queryUtility(IRegistry, context=portal)
language = reg['plone.default_language']

by the previous version:

def _get_locales_info(portal):
language = portal.Language()

That's a lot of add-ons to leave in there if you're trying to upgrade. Have you read this? https://docs.plone.org/manage/upgrading/index.html

As I Said, upgrading Plone from 4 to 5 went fine.

Now as my Site is Plone Version 5.08 after upgrading from 4.3 means that my content types are archetypes and I want them to be Dexterity types.

The migration via @@atct_migrator does not work.
Obviously this exception is caused by a folder to folder conversion?

This folder exists and works fine.

MigrationError: MigrationError for obj at /myPlone/myFolder (Folder -> Folder):
Traceback (most recent call last):
  File "/plone/myPloneSite/buildout-cache/eggs/Products.contentmigration-2.1.16-py2.7.egg/Products/contentmigration/basemigrator/walker.py", line 192, in migrate
    migrator.migrate()
  File "/plone/myPloneSite/buildout-cache/eggs/Products.contentmigration-2.1.16-py2.7.egg/Products/contentmigration/basemigrator/migrator.py", line 214, in migrate
    self.renameOld()
[..]
  File "/plone/myPloneSite/buildout-cache/eggs/plone.outputfilters-3.0.1-py2.7.egg/plone/outputfilters/browser/resolveuid.py", line 31, in uuidToObject
    return res[0]._unrestrictedGetObject()
  File "/plone/myPloneSite/buildout-cache/eggs/Products.ZCatalog-3.0.2-py2.7.egg/Products/ZCatalog/CatalogBrains.py", line 80, in _unrestrictedGetObject
    return parent.unrestrictedTraverse(self.getPath())
  File "/plone/myPloneSite/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/OFS/Traversable.py", line 300, in unrestrictedTraverse
    raise e
KeyError: 'myFolder'

Have you tried Googling for migration instructions from Archetypes to Dexterity? (I looked through docs.plone.org but didn't find anything specific there, but found this http://bsuttor.herokuapp.com/2016/02/migrate-archetypes-content-types-to-dexterity among other results for "plone migrate to dexterity")

I would try it, but my code in /plone/app/contenttypes is as follows:

def _get_locales_info(portal):
language = portal.Language()
parts = (language.split('-') + [None, None])[:3]
locale = locales.getLocale(*parts)

# If we get a territory, we enable the combined language codes
if locale.id.territory:
    return locale.id.language + '_' + locale.id.territory, True, locale

return locale.id.language, False, locale

As my code original differs from yours I am not sure what to change here.

Thanks!

Regarding the link you provided I cannot believe that I have to do so much coding, just to migrate a standard Plone site with some pages, folders and images and no custom contenttypes.

I've thought standard migration is provided by Plone as is migrating Archetypes to Dexterity.

Plone Foundation Code of Conduct