Migrate from MS SQL Server to MySQL

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
Eidothea
Posts: 1
Joined: Mon 25 Nov 2013 10:28

Migrate from MS SQL Server to MySQL

Post by Eidothea » Mon 25 Nov 2013 10:49

Dear Sirs,

we are working on a migration from MS SQL Server to MySQL.
At the moment we are using a LINQ-to-SQL entity class (dbml file) for the database stored in a MS SQL Server. We created an identical database with alls tables, views and stored procedures on a MySQL server.

My questions are:
- What is the best way to migrate the existing LINQ-to-SQL class to MySQL?
- Do you have any tutorials or other documents we should begin with?
- Is there a way to let customers choose, which server they want to use?

Many thanks in advance!

Best Regards
Bodo

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Migrate from MS SQL Server to MySQL

Post by MariiaI » Wed 27 Nov 2013 10:26

What is the best way to migrate the existing LINQ-to-SQL class to MySQL?
If you are working with dotConnect for MySQL and, according to your post, there is already an identical database with all tables, views and stored procedures on a MySQL server, you can just create a new LinqConnect model with all necessary objects and generate the code.

If you are working with LinqConnect (as a separate product), you can do it via the LinqConnect Migration Wizard (Tools-> LinqConnect-> Migration wizard), which allows migrating from a LINQ to SQL model to a LinqConnect model.
After completing the steps of the LinqConnect Migration Wizard and getting the *.lqml file, you should do the following in your application:
- open the model (*.lqml file);
- select "New Template" from the shortcut menu of the "Templates" node in Model Explorer and then select the "LinqConnect" template;
- save changes and re-generate your model.

After saving the model, the code for DataContext and its entities should be generated.
Please inform us if this helps.
Do you have any tutorials or other documents we should begin with?
LinqConnect documentation is available here:
http://www.devart.com/linqconnect/docs/?
http://www.devart.com/linqconnect/demo.html

LinqConnect samples are available in the "C:\Program Files (x86)\Devart\dotConnect\Linq\Samples\" folder after installing LinqConnect (if the Samples component has been selected during installation).
Is there a way to let customers choose, which server they want to use?
You could create XML mapping files for each database and switch between them by changing the connection string and the mapping file:

Code: Select all

TestDataContext context = new TestDataContext(connectionString1, mappingSource1);
or

Code: Select all

TestDataContext context = new TestDataContext(connectionString2, mappingSource2);
For more information please refer to this topic:
http://forums.devart.com/viewtopic.php?f=31&t=24588
Also, please pay attention to the Fluent mapping approach: http://www.devart.com/linqconnect/docs/ ... pping.html

Post Reply