2👍
For every plugin you create, there’s two versions once you publish.
The public and the draft versions. So its perfectly fine for the ids to change.
Because relationships vary from project to project, anytime your plugin has relationships, you need to explicitly tell the cms how to “copy over” these relationships when publishing the page.
Please adapt your plugin model to have the following method:
def copy_relations(self, oldinstance):
self.structure_to_exclude = oldinstance.structure_to_exclude.all()
You can read more about plugin relations in our docs.
Source:stackexchange.com