Maintaining zope intids on zexp imports

Thanks for the tip, I investigated that and thought I could perhaps just update the oid of the keyreferences with something like this

def repair_intids():
    intids = getUtility(IIntIds)
    for key_ref in intids.ids:
        if key_ref.object and key_ref.oid and key_ref.object._p_oid != key_ref.oid:
            key_ref.oid = key_ref.object._p_oid

That actually does not work, although I would have thought it did. Also key_ref.dbname is the same on both.

Perhaps this is moot because my previous suggestion of doing intids.ids.clear() and rerunning the plone.app.intids does appear to preserve my relations. If I check intids.ids afterwards, it has correctly put my z3c.relationfield.relation.RelationValue objects in there, and both my existing relations and new relations appear to work as expected.