Keep value of registry record between uninstalling and reinstall package

guys, in profiles/default/registry/main.xml
i have a registry record:>

    <record name=".....">
            <field type="plone.registry.field.Text">
            <title>long text</title>
            <description>.....</description>
            <required>False</required>
            </field>                
            <!--  <value purge="false"></value> -->         
    </record>

after reinstalling the package, i lost the value of record.
Is there any simply trick to keep the value of registry record?

Many thanks.

You could probably use a 'setuphandlers' (there is a pre_handler and a post_handler) and set the value (if it does not exist) with:

plone.api.portal.set_registry_record

Also: make sure that the uninstall profile does not remove it.

This has bitten a few community members as well.

I managed to make a PR to fix it, see:

It needs to be polished to get merged, but, hopefully within a few months there will be a fix upstream :crossed_fingers:t4: