Convert database and keep relations

I have a DevTask database for tasks related to product development. I want to merge all these DevTasks into another Task database, while keeping relations between entities and possibly references.

For example, I have a Product “MyProduct” linked to the two DevTasks “Make prototype” and “Document results” through a one-to-many Product-DevTasks relation. I have created a new Task database with similar fields and one-to-many relation between Product and Tasks.

I want to convert the DevTasks to Tasks while transferring the relational links so that “MyProduct” has the converted Tasks “Make prototype” and “Document” linked inside it through the one-to-many relation.

Anyone who has a good solution for this?

It should be fairly easy to write a script to do this - and it would be interesting to see how the “AI script assistant” handles this challenge - Automations Script AI Assistant

1 Like

If the two databases have the same relations, then you can convert a DevTask entity to a Task entity and it should retain the same parent Product

3 Likes

Thanks for a quick feedback here @Chr1sG and @Matt_Blais. I really appreciate that.

Unfortunately, @Chr1sG , your proposal did not work in my case, and I don’t know why. The relation I want to preserve is identical, but all relations are not the same, so that may be it.
I will try again, by setting relations identical first. Will revert with som results here.

Comment to solution: In my first try, converting the DevTask entity to a Task entity did not retain the parent Product, even though I had the same relation to the parent database (Product). This was because the relation field in the source (DevTask) and target database (Task) were named slightly differently. When these field names were identical, the relations were retained.

@Matt_Blais, I had a quick look at the demo of the script AI assistant; it looks pretty neat.
I preferred to figure out how the built-in functionality for retaining relations worked first, but I’ll definitely try this out.