Database copy


I'm wondering if there is an easy way to copy all data from two database that use the same entity model (in order to perform a smooth migration: I'm not looking for an synchronization tool like echo, just a code to load all entities from the first DB into a second one without having to manually clone every entity).

There is no such tool, unfortunately, although you can gather metadata information about the database using TMappingExplorer methods and try to build SQL statements yourself. You can for example get the list of tables and the columns in each table and try to perform the SQL. But nothing ready-to-use.

Thank you for your answer.

Actually, it's not the schema that I'm talking about: both DB share the same schema so that's being taken care of. it's the actual content of the tables.

I understand. Indeed, to accomplish that you will have to copy each entity manually. Still you can try to use helper methods in TMappingExplorer. But you can try to start simply by using Manager.Find(SomeClass) to grab objects and replicating it into another Manager that connects to the target database using Manager.Replicate(SomeObject).

Thank you. I will see what I can do using this method.