The project(a static library) had a single data model with entities which could actually be grouped by their concerns and put into separate data models but was not separated because necessity did not arise in the beginning when the project was designed. But now as the project has grown and we are refactoring code to modularise it, the data model had to be split into one single core data model and other models belonging to each module.The challenge now is that we are unable to figure out how to safely migrate with this scenario.
To be clear---
- In the beginning --- The Project(with no modules) had single data model called CoreDataModel with entities, A,B,C,D.
- Now ---------------- The Project has 1 module(a separate static library itself with main project lib as dependency) with the original CoreDataModel split into two 1) CoreDataModel with entities A,B. 2) ModuleDataModel with entities C,D.
Now to safely migrate I want the data existing in current app belonging to the original CoreDataModel(in file CoreData.sqllite) to be separately(with respect to their belonging entities) put into CoreData.sqllite and ModuleData.sqllite.