How to Change a DBMS for an Existing Model

Sometimes you need to switch a database management system after you have been developing your ORM-based application for some time. Usually you want to keep your ORM data model as close to the original one as possible in order to decrease the amount of application code changes. Entity Developer allows you to re-generate model storage and mapping parts for an existing model when you change the database provider and connection for the model in order to make the mode compatible with another DBMS chosen. The conceptual model part, it's entities and properties are left intact.

In order to change a DBMS for an existing model, perform the following actions:

1.Right-click the connection in the Database Explorer window and select Edit Connection Properties from the shortcut menu.

 

Images_EditConnectionProperties

2.In the Provider drop-down list, select the required provider.
3.Specify the parameters of the connection to the new database server, and click OK.
4.After changing your connection settings, your model still holds storage part and model mapping for the previous database and the model is not valid because some data types different DBMS are different. Entity Developer allows you to quickly regenerate storage and mapping part based on your entity classes. Right-click the diagram and on the shortcut menu click Regenerate Storage and Mapping.
5.Save the model.

note Note

When regenerating storage and mapping, all the custom changes made to the model mapping and storage parts are lost. You will need to redo them manually.

After this, you even can generate a script that creates the corresponding database tables in the new database. However, note that the script generation functionality is limited, the script generated will preserve only the database schema details necessary for ORM model work. Some database details may not correspond to the previously used database, and Entity Developer will not generate stored procedures and functions used in the model.

 


Send feedback on this topic

© 2008 - 2024 Devart. All rights reserved.