Upgrading add-on from Plone 4 to Plone 5

I am working on a Plone 4 add-on which is based on Archetype and going to upgrade it from Plone 4 to Plone 5. In addition to the guide here Upgrade a custom add-on to Plone 5, is there anything else I have to pay attention to during rewriting?

What's more, if I want to migrate it to Dexterity, is there any easier solution? I didn't find related infomation in docs. I wonder how large is the work load(I know it is proportional to the scale of the add-on, so I mean an intuitive sense)

Thanks in advance!

Moving an addon from Plone 4 to Plone 5 can range from trivial to complex depending on the underlaying code. Expect a major degree of pain with third-party JS module in case you are using third party JS modules. Also read the docs on moving from AT to Dexterity. Plone 5 has a migration path and a migration tool for that...but in general it requires touching all code where you get or set content type values.

-aj

thx!
I found that the migration tool is to help to migrate instances, I also wanted some guide for rewriting the add-on content type using Dexterity.

See https://github.com/plone/plone.app.contenttypes#migrating-custom-content on how to migrate your content once you created the new types.
On how to create dexterity types you should read http://docs.plone.org/external/plone.app.dexterity/docs/index.html. https://training.plone.org/5/mastering_plone/index.html also covers dexterity in several chapters.

I'm probably the person who has work most on this topic over the past months and I would suggest you the following:

do not try to migrate from Archetypes to Dexterity and to support Plone 5 at the same time; that could be hard and painful depending on the complexity of your add-on.

there are many API differences among Archetypes and Dexterity-based content types; there are also many changes among Plone 4 and Plone 5, resource registries being just one of them.

these are thing that you need to do or take into account:

  • create CI builds for Plone 4.3, Plone 4.3 with plone.app.contenttypes installed, Plone 5 and, recently, Plone 5.1
  • move any configuration still on the portal_properties tool to plone.app.reistry
  • refactor any configlet using zope.formlib to use z3c.form
  • link integrity in Plone 4.3 works different than in Plone 5
  • the calendar_tool is gone in Plone 5
  • documentbyline viewlet is not visible by default in Plone 5
  • hard dependencies on plone.app.referenceablebehavior and plone.app.stagingbehavior must be removed (this is only for Dexterity based content types)
  • RobotFramework tests could fail as some widget are different (image and file fields) and some status messages for the same action are also different
  • don't mess around with resource registries yet as the current solution to support both Plone versions is buggy and overly complex; wait for Plone 5.1

a final disclaimer: my use cases are special because I decided to go with Dexterity 5 years ago and I want to support both Plone versions at the same time; I spend a lot of time trying make tests compatible with both versions because I think that's important and that will save me time in the future.

in you case is probably easier to write a new content type and make an in place migration using a tool like ftw.upgrade.

if you want to see examples of all the above check the commit history on the following packages:

good day and good luck!