Migrating database schema from Microsoft SQL Server to Oracle using Entity Framework and Devart dotConnect
This walkthrough covers the migration of tables and primary/foreign keys that is a reasonable assumption when accessing data using ORM.
- Visual Studio 2010 (should also work with Visual Studio 2008 with .NET 3.5 SP1 applied).
- Devart dotConnect for Oracle (formely known as OraDirect.NET) that supports Entity Framework capabilities.
Steps to migrate data schema
1. Create a C# class library project using Visual Studio 2010.
2. Delete a class created in a projects (“Class1”) and add a new item using “ADO.NET Entity Data Model” template.
3. Select “Generate from database” and choose SQL Server database that contains the schema to be migrated.
4. Select “Tables” in the next screen (“Choose Your Database Objects”), and Visual Studio will generate a model based on the selected database schema.
Now if you right-click on a model diagram, Visual Studio will display a menu with an option “Generate Database from Model…”
If you choose database generation, Entity Designer will generate a script for Microsoft SQL Server.
4. Assuming Devart dotConnect is installed, it should be possible to change a template that is used to generate database script. Open “DDL Generation Template” combo box in Entity Designer Properties window and select “Devart SSDLToOracle.tt (VS)”.
5. After the change of DDL generation template execute “Generate Database from Model” and you should get a script for Oracle data schema: