Issuu on Google+

Knowledge Base How To: Convert from MySQL to MSSQL NOTE: In fact, the conversion from MySQL to MSSQL is a complex process, the support for this conversion is not included in the standard DocuWare support. If you want our help during the conversion you can get it liable for costs. You can contact the DocuWare Support to get more information about Professional Service. 1.

Introduction .................................................................................................................................................. 2

2.

Requirements ............................................................................................................................................... 2

3.

Process Overview ....................................................................................................................................... 3 3.1.

4.

5.

6.

How fast is the export from MySQL to MSSQL? ........................................................................ 3

Back Up and Restore DWSystem ........................................................................................................... 3 4.1.

Back Up in MySQL database system ............................................................................................. 3

4.2.

Installation of Content and Workflow Server .............................................................................. 6

Microsoft SQL Server Migration Assistant 2008 for MySQL ........................................................... 7 5.1.

Preparation ........................................................................................................................................... 7

5.2.

Create and configure the project .................................................................................................... 7

5.3.

Create tables on MSSQL Server 2008............................................................................................ 9

5.4.

DocuWare “Memo� field .................................................................................................................. 10

5.5.

Data migration ................................................................................................................................... 10

Post processing ........................................................................................................................................ 11 6.1.

Number: Date: Author:

Index ..................................................................................................................................................... 11

0548 26. February 2010 Christian Toussaint & Juan Tenemaza

Title:

How To: Convert from MySQL to MSSQL

Page - 1 -


1. Introduction Many of our DocuWare partners have asked us whether we support a conversion from MySQL to MSSQL. The reasons for this included performance losses with MySQL when there were many records in the file cabinets and/or large full text tables. In other cases, people wanted to use an existing MSSQL. The reasons for that concern the relations in the “DWSystem” database. If a relation is not correct in that database, the whole DocuWare system can become unstable. With DocuWare 5.1b Service Pack 2a, we are now offering the option of backing up this DocuWare system database via DocuWare Administration. This backup is saved in XML format and can also be imported into other database systems.

2. Requirements This process was tested on the following databases and operating systems: Source database:  MySQL 5.0.23 Target databases:  MSSQL Server 2008 (with Analysis Service and Integration Service installed) Operating system:  Microsoft Windows Server 2003 or Windows Server 2008 DocuWare:  DocuWare 5.1b with SP3 Other programs:  Microsoft SQL Server Migration Assistant 2008 for MySQL (click here)  MySQL Connector ODBC 5.1.6 (click here)

Number: Date: Author:

0548 26. February 2010 Christian Toussaint & Juan Tenemaza

Title:

How To: Convert from MySQL to MSSQL

Page - 2 -


3. Process Overview       

Back up “DWSystem” on MySQL server using DocuWare Administration tool. Prepare the Microsoft SQL 2005 or 2008 Install DocuWare 5.1b with SP2 on SQL server. Restore “DWSystem” on SQL server Migrate “DWData with Microsoft SQL Server Migration Assistant 2008 for MySQL Verify the records Modify the third-party programs that interact with DocuWare System

The duration of the project depends mainly on the following factors:   

How many third-party programs have to be customized Whether web accesses have to be customized Amount of data and size of file cabinets

3.1. How fast is the export from MySQL to MSSQL? We used for the conversion the following configuration: MySQL:  VM with Windows 2003 SP2  MYSQL 5.0.23  2 GB RAM MSSQL:  Notebook with Windows 7  MSSQL SERVER 2008  1,5 GB RAM allocated to the MSSQL Server  Records exported Lines

Data volume in MB

40,129,926

1,336

Index volume in MB 2,938

Time in hours 02:10:38

4. Back Up and Restore DWSystem 4.1. Back Up in MySQL database system   

Number: Date: Author:

Do an file backup of the whole MySQL directory (security purpose only) Create a backup path under Workflow server setting in Administration tool. Create a backup of the DWSystem via DocuWare Administration. Under “DocuWare – System”.

0548 26. February 2010 Christian Toussaint & Juan Tenemaza

Title:

How To: Convert from MySQL to MSSQL

Page - 3 -


Restore NOTE: If Microsoft SQL is installed in the same machine where MySQL is installed, please STOP MySQL database (DocuWare Internal Database) before you run a restore. To restore the DWSystem on the MSSQL database, proceed as follows:     

Number: Date: Author:

Install Authentication Server and choose the new database. o If you use MSSQL 2008 follow the guide lines in knowledge base article 054 Install the DocuWare 5.1b client on the same computer. Install SP3 for Client and Authentication Server. Perform a database backup of MSSQL (security purpose only) Open DocuWare Administration and start the restore process wizard via the o Tools  Restore System Settings. o For database connections that are not currently being accessed you can, if necessary, adapt the connections or specify alternative database connections.

0548 26. February 2010 Christian Toussaint & Juan Tenemaza

Title:

How To: Convert from MySQL to MSSQL

Page - 4 -


 Here you specify the storage location where Images are located on the new server

 Now you specify the logging database connections to the new MSSQL 2008 server. You have to use a different name because of the exiting connection

Number: Date: Author:

0548 26. February 2010 Christian Toussaint & Juan Tenemaza

Title:

How To: Convert from MySQL to MSSQL

Page - 5 -


 As next you specify the database connection to “DWData” in MSSQL 2008. You have to use a different name because of the exiting connection

 Hit Start and let the process run. When it is done the administration tool will be closed and you have to login to the restored system.

4.2. Installation of Content and Workflow Server Make sure the SP3 content is extracted to the DWUpdate directory under the installation directory.  Install Content Server with the option to replace.  Install SP3 for Content Server  Install Workflow Server with option to replace.  Install SP3 for Workflow Server

Install the other components required, e.g. Web Client Server or SAP HTTP Server. Number: Date: Author:

0548 26. February 2010 Christian Toussaint & Juan Tenemaza

Title:

How To: Convert from MySQL to MSSQL

Page - 6 -


5. Microsoft SQL Server Migration Assistant 2008 for MySQL 5.1. Preparation You can download the SQL Server migration Assistant 2008 for MySQL (SSMA) here. After The Installation you need a license for running SSMA. Register by Microsoft to get a license for SSMA. You will find the Link on the first window after you started SSMA.

To establish a connection to MySQL you will need the MySQL ODBC Connector 5.1.6 which you can download here.

5.2. Create and configure the project After you started SSMA create a new project by clicking on “File\New project” in the menu bar and type in a name for this project. As next you have to establish a connection to MySQL. Press the according button and type in the needed parameters

As next you have to establish the connection to MSSQL 2008. At this point you have to type in Number: Date: Author:

0548 26. February 2010 Christian Toussaint & Juan Tenemaza

Title:

How To: Convert from MySQL to MSSQL

Page - 7 -


the target database. In our case it is the DWData. Be sure that this database already exists.

In SSMA you can set the database mapping. Be sure that the ”DWData” from MySQL is mapped to the “DWData” on MSSQL.

You also can set the mapping of the field types. In this case you have to change the mapping for the field type “datetime”. Mark the tables in the MySQL part of SSMA and change on the right site the mapping of the field type. Settings for changing the mapping:

Settings after changing the mapping:

Number: Date: Author:

0548 26. February 2010 Christian Toussaint & Juan Tenemaza

Title:

How To: Convert from MySQL to MSSQL

Page - 8 -


5.3. Create tables on MSSQL Server 2008 As next the tables have to be created on the MSSQL Server 2008. For that click right on “DWData” in the MySQL part of SSMA and choose “Convert Schema” On the MSSQL part the schema of “DWData” should be automactily expanded and the tables will be added in the MSSQL schema. If you got a message that the table “DWSys” already exists…. just overwrite this table. Now you should see all tables in the MSSQL part of SSMA. Now you have to synchronize the tables from the SSMA to the MSSQL Server. Just right click on the tables in the MSSQL part of the SSMA and choose “Synchronize”

Before the tables will be synchronized you got an overview which objects should be synchronized to the MSQL Server. Just press ok Number: Date: Author:

0548 26. February 2010 Christian Toussaint & Juan Tenemaza

Title:

How To: Convert from MySQL to MSSQL

Page - 9 -


After it is finished all tables of the “DWData” form MySQL are created on the MSSQL Server

5.4. DocuWare “Memo” field If you use a “Memo” field in one of you file cabinets you have to change the field type manually. Because at the moment you can’t do an mapping between the MySQL field type “text” and the MSSQL field type “ntext. Use the MSSQL Server Management Studio to change the field type. Right click on the according table and choose “Design”. Now change the field type.

5.5. Data migration Now you can migrate the data from MySQL to MSSQL. Do a right click on “Table” in the MYSQL area of SSMA and choose “Migrate Data”. Number: Date: Author:

0548 26. February 2010 Christian Toussaint & Juan Tenemaza

Title:

How To: Convert from MySQL to MSSQL

Page - 10 -


After you logged on to MySQL and MSSQL the migration will start. In the Output window you can see the progress of the migration. After finishing you got a report about the amount of migrated data and a comparison of data in MySQL tables and data in MSSQL tables.

6.

Post processing

6.1. Index

Number: Date: Author:

0548 26. February 2010 Christian Toussaint & Juan Tenemaza

Title:

How To: Convert from MySQL to MSSQL

Page - 11 -


It is possible that not all indices which you had set on the file cabinet will be created on the MSSQL Server. You will get a note in the output window of SSMA if this is the case. If some indices could not be created you have to do that manually with the DocuWare Administration or with the Microsoft MSSQL Management studio. In the DocuWare Administration you can set the index under â&#x20AC;&#x153;Organization\File cabinet\fields\<fieldname>

Number: Date: Author:

0548 26. February 2010 Christian Toussaint & Juan Tenemaza

Title:

How To: Convert from MySQL to MSSQL

Page - 12 -


convert from mysql to sql