Hello Benoit Nesme,
If you have exactly the same domain model in both databases then this is relatively simple merge. Say, we have a 'master' database and a 'slave' one and we are going to inflow data from the 'slave' to the 'master'.
Just perform following things:
1) Backup both databases.
2) compare content of Metadata.Type and make sure that each type has the same type id in both databases. If they are equal then go to the next step. Otherwise, you need to correct type ids of the 'slave' in order to have the same type ids as in the 'master'. Each table containing TypeId column should updated with correct type ids.
3) Add to every ID value in the slave some skip value. For instance, if the master had IDs from 1 to 234 567 and the slave had IDs form 1 to 223 344 then we could add 300 000 to each ID in the slave so they would be from 300 001 to 523 344 and would not interfere with each other.
4) Copy data using INSERT INTO dst SELECT FROM src.
5) Validate that everything is copied successfully and correctly.
6) Change settings of Key generators so they will not generate keys lower than new maximum of key values.
By the way, DataObjects.Net 5.0 has a feature allowing to add storage nodes to domain - each node shares domain model and can work with its own schema or database and after building a domain and additional nodes you need to choose some node for certain session and work with it separately.
answered
Mar 26 '18 at 06:15
Alexey Kulakov
772●2●5