The Restore process changes all the ids, can we get a map of new to old?

We are planning on having several apps in Squidex represent “templates” to be restored and edited. These apps have content in them, some of which references other content by Id. When restored, those Id’s are all changed and our content can no longer find what it was previously referencing.

Is there a way around this ?

Can the restore process store the map of new to old (I believe the GuidMapper in the BackupReader build this) somewhere that is accessible (RestoreJobDto) ?

Can we have a BackupHandler whose RestoreAsync method uses the GuidMapper in the reader to make changes to the content ?

Any thoughts ?

Thanks

Russell McGinnis

Thats true, the goal of the restore job is also to be able to clone an app. Therefore all Ids are regenerated. If you need a safety backup I would recommend to just use mongo-restore.

But if you want to transfer an app to another server it might be helpful to keep the Ids. We could add a flag to the process. Do you want to provide a PR?

We are implementing a multi-tenant website builder on top of Squidex and the idea is that we will have already built several template sites - each one with its content in a separate Squidex App. When someone signs up for a new site and picks their template, we want to copy over that “template App” to an actual “site App”. This means we will be on the same Squidex server and don’t want to necessarily keep the IDs from the “template App”.

I can see how a flag to “keep existing IDs” would be useful for other scenarios, but not in our case I believe.

I’m not sure our scenario necessarily is the responsibility of the Squidex server to solve, but if we can get the GuidMapping.oldtonewids Dictionary out of the Restore process, our process can then make the required adjustments to the content.

I’m going to look at that today unless you feel there is a better approach ?

Thanks

Russell McGinnis

Now I get it. We could put the IDMap to the AssetStore and add the URL to the output.

But in your case I would build the templates outside Squidex and use the API for that. I have done it in a custom project and it works very well.

The IDMap in the AssetStore would be ideal, but I’ll also look at storing the templates outside of Squidex and use the API to “import”

Speaking to my team, we would really appreciate this feature. Is this something you can fit in ?

PR would be also welcome :wink:

I’ll give it a go and let you know my progress.

1 Like

Hi, how is it going? It this still relevant?