Pre Migration
1. Download & Install SQL Server Migration Assistant for MySQL
https://docs.microsoft.com/id-id/sql/ssma/sql-server-migration-assistant?view=sql-server-2017
2. Download Driver Connector ODCB ( version 5.2 - 5.3.3) & Install
https://dev.mysql.com/downloads/connector/odbc/
3. Optional Backup Database MySQL/MariaDB
4. Capture database & table MySQL/MariaDB (sample existing (Source) dbname = teguhth). select data type mysql
select * from INFORMATION_SCHEMA.TABLES where table_schema = 'teguhth'
5. Create new destination database SQL Server (sample new(destination) dbname = ls)
select * from INFORMATION_SCHEMA.TABLES
Activity Migration
1. Open SQL Server Migration Assistant for MySQL & create new project
2. fille form & Ok
Name : SqlMigration-teguhthMySQL-to-lsMSSSQL
Migration to : SQL Server 2012 (choose for version MSSQL)
3. On SQL Server Migration Assistant for MySQL, press button "Connect to MySQL" an fill form & connect
Drive : MySQK ODCB 5.3
Server Source: localhost
Server Port: 3306
User : root
password: <xxxx>
4. Filter objects and ok
5. on MySQL Metadata Explorer, select tables from database that will be migration
6. On SQL Server Migration Assistant for MySQL, press button "Connect to SQL Server" an fill form & connect
Database destination : ls
Authentication : SQL Server Authentication
User Name : sa
password: <xxxx>
7. on MySQL Metadata Explorer, select tables from database that will be migration, press button Convert Schema
8. on SQL Server Metadata Explorer, select tables from database that will be Migrated (restore) and syncronize with Database
Connection string: Data Source=127.0.0.1;Integrated Security=False;User ID=sa;Pooling=False;Encrypt=False;Application Name="SSMA for MySql"
Synchronizing objects with database...
Analyzing metadata...
Preparing category Tables of schema ls.teguhth...
Preparing table ls.teguhth.barang...
Preparing category Triggers of table ls.teguhth.barang...
Preparing category Indexes of table ls.teguhth.barang...
Preparing table ls.teguhth.customer...
Preparing category Triggers of table ls.teguhth.customer...
Preparing category Indexes of table ls.teguhth.customer...
Preparing table ls.teguhth.pasok...
Preparing category Triggers of table ls.teguhth.pasok...
Preparing category Indexes of table ls.teguhth.pasok...
Preparing index ls.teguhth.pasok.KODE_BARANG...
Preparing index ls.teguhth.pasok.KODE_SUPLIER...
Preparing table ls.teguhth.pembelian...
Preparing category Triggers of table ls.teguhth.pembelian...
Preparing category Indexes of table ls.teguhth.pembelian...
Preparing index ls.teguhth.pembelian.KODE_BARANG...
Preparing index ls.teguhth.pembelian.KODE_CUSTOMER...
Preparing table ls.teguhth.suplier...
Preparing category Triggers of table ls.teguhth.suplier...
Preparing category Indexes of table ls.teguhth.suplier...
Starting Phase #0
Synchronizing ls.teguhth ...
Loading to database new table ls.teguhth.barang ...
Loading to database new table ls.teguhth.customer ...
Loading to database new table ls.teguhth.pasok ...
Loading to database new table ls.teguhth.pembelian ...
Loading to database new table ls.teguhth.suplier ...
Loading to database new table ls.teguhth.barang primary keys ...
Loading to database new table ls.teguhth.customer primary keys ...
Loading to database new table ls.teguhth.pasok primary keys ...
Loading to database new table ls.teguhth.pembelian primary keys ...
Loading to database new table ls.teguhth.suplier primary keys ...
Loading to database index ls.teguhth.pasok.KODE_BARANG ...
Loading to database index ls.teguhth.pembelian.KODE_BARANG ...
Loading to database index ls.teguhth.pembelian.KODE_CUSTOMER ...
Loading to database index ls.teguhth.pasok.KODE_SUPLIER ...
Loading to database new table ls.teguhth.pasok foreign keys ...
Loading to database new table ls.teguhth.pembelian foreign keys ...
Loading to database new table ls.teguhth.barang columns default ...
Loading to database new table ls.teguhth.customer columns default ...
Loading to database new table ls.teguhth.pasok columns default ...
Loading to database new table ls.teguhth.pembelian columns default ...
Loading to database new table ls.teguhth.suplier columns default ...
Synchronization operation is complete.
9. on MySQL Metadata Explorer, select tables from database that will be migration, press button Migration Data and connect
Mode : Standard mode
Drive : MySQK ODCB 5.3
Server Source: localhost
Server Port: 3306
User : root
password: <xxxx>
Server Name : localhost
Database destination : ls
Authentication : SQL Server Authentication
User Name : sa
password: <xxxx>
10. Waiting until success
Analyzing metadata...
Preparing table teguhth.barang...
Preparing table teguhth.customer...
Preparing table teguhth.pasok...
Preparing table teguhth.pembelian...
Preparing table teguhth.suplier...
Preparing data migration package...
Starting data migration Engine
Starting data migration...
The data migration engine is migrating table '`teguhth`.`barang`': > [ls].[teguhth].[barang], 6 rows total
The data migration engine is migrating table '`teguhth`.`customer`': > [ls].[teguhth].[customer], 6 rows total
The data migration engine is migrating table '`teguhth`.`pasok`': > [ls].[teguhth].[pasok], 12 rows total
The data migration engine is migrating table '`teguhth`.`pembelian`': > [ls].[teguhth].[pembelian], 15 rows total
The data migration engine is migrating table '`teguhth`.`suplier`': > [ls].[teguhth].[suplier], 6 rows total
Table `teguhth`.`pasok` data migration: 12 rows processed.
Completing migration of table `teguhth`.`pasok`...
Table `teguhth`.`pembelian` data migration: 15 rows processed.
Completing migration of table `teguhth`.`pembelian`...
Table `teguhth`.`barang` data migration: 6 rows processed.
Completing migration of table `teguhth`.`barang`...
Table `teguhth`.`suplier` data migration: 6 rows processed.
Completing migration of table `teguhth`.`suplier`...
Migration complete for table '`teguhth`.`pasok`': > [ls].[teguhth].[pasok], 12 rows migrated (Elapsed Time = 00:00:00:10:662).
Migration complete for table '`teguhth`.`pembelian`': > [ls].[teguhth].[pembelian], 15 rows migrated (Elapsed Time = 00:00:00:10:646).
Migration complete for table '`teguhth`.`barang`': > [ls].[teguhth].[barang], 6 rows migrated (Elapsed Time = 00:00:00:10:703).
Migration complete for table '`teguhth`.`suplier`': > [ls].[teguhth].[suplier], 6 rows migrated (Elapsed Time = 00:00:00:10:613).
Table `teguhth`.`customer` data migration: 6 rows processed.
Completing migration of table `teguhth`.`customer`...
Migration complete for table '`teguhth`.`customer`': > [ls].[teguhth].[customer], 6 rows migrated (Elapsed Time = 00:00:00:10:675).
Data migration operation has finished.
5 table(s) successfully migrated.
0 table(s) partially migrated.
0 table(s) failed to migrate.
Post Migration
1. Open Microsoft SQL Studio & connect Database SQL Server
2. Open MySQL Workbench & connect MariaDB
No comments:
Post a Comment