Hi There. I hope I can help.
You found a bug... a old bug noone cared about enough to work on:
https://web.archive.org/web/20131026035512/https://dev.plone.org/ticket/12785
We have a home cooked solution that stores the html filtering data in 'portal_transforms.xml' and adds the import/export to generic setup profiles - allowing you to save those settings in a Generic Setup way. Unfortunately, our Plone 4 build on github is MARKED PRIVATE (I grumble at management....) But I'll do my best to share the components and steps.
What we accomplish here is creating a Generic Setup step for Portal Transforms to import and export these data from/to your GS Profile.
This stuff should really be in Products.PortalTransforms but we never asked for it to be pulled in:
( points finger at @tseaver )
Good reading about what we are doing here: https://productsgenericsetup.readthedocs.io/en/latest/handlers.html
Step 1: add an export step to your export_steps.xml
<export-step id="transforms" handler="Products.rfasite.setuphandlers.exportPortalTransformsTool" title="Transforms">
Export portal_transforms tool settings.
</export-step>
step 2: Add an import step to your product in your import_steps.xml
<import-step id="transforms" handler="Products.rfasite.setuphandlers.importPortalTransformsTool" title="Transforms">
<dependency step="toolset"/>
Import portal_transforms tool settings.
</import-step>
These make the steps appear in your ZMI under portal_setup.
Put the code behind it in YOUR setuphandlers:
https://pastebin.com/DPcipFpJ
Next: run your export from the ZMI on your older plone instance to generate the portal_transforms.xml file. It will have lots of stuff in it, but specifically your html filter tag settings:
<?xml version="1.0"?>
<object name="portal_transforms" meta_type="Portal Transforms">
<property name="title"></property>
<transform name="html_body"
module="Products.PortalTransforms.transforms.html_body"/>
<transform name="html_to_plone_outputfilters_html"
module="plone.outputfilters.transforms.html_to_plone_outputfilters_html"/>
.... snip ...
<nasty_tag long="1" tag="applet"/>
<nasty_tag long="1" tag="meta"/>
<valid_tag long="1" tag="a"/>
....
<valid_tag long="1" tag="var"/>
<valid_tag long="1" tag="video"/>
</transform>
....
</object>
Oy hey, yeah, add the adapter defined in (the pastebin) to your configure.zcml -
<adapter
factory=".setuphandlers.PortalTransformsToolXMLAdapter"
provides="Products.GenericSetup.interfaces.IBody"
for="Products.PortalTransforms.interfaces.IEngine
Products.GenericSetup.interfaces.ISetupEnviron"
/>
Now, do your upgrade.
A manual step now - go back to the ZMI, choose your profile and import the Portal Transforms Tool.
I guess you could add an upgrade step to accomplish this too, if you didn't want to visit the ZMI for each website to export and import.
I hope this is some use to you. Wish there was a better answer.