I’m writing this mainly as a guide to myself in case I need to do this again in the future. I had to do this last year too, it was a headache each time to find an approach that worked.
My goal is to copy the tables and data from a Microsoft SQL Server database hosted with Blacknight.com to a local mySQL database.
The process is a bit long winded as it is currently not possible to connect directly to a MSSQL database hosted with Blacknight using a 3rd party database manager.
The following software is used in the following steps.
- Microsoft SQL Server Express 2008 R2 (
- SQLyog (A 30-day free trial is available)
It is assumed that you already have a mySQL database up and running on your local machine to import the information in to.
Step 1.
The first step is to export a backup of the current Microsoft SQL Server database. Blacknight offer a control panel called ‘myLittleBackup’ to allow me to log in and create 1 backup of the database which I can then download. The result is a .bak file downloaded to my desktop.
Step 2.
To begin working with the .bak file, I need to download and install ‘Microsoft SQL Server Express’. The current version I used is SQL Server 2008 R2 Express, 64 Bit. It is free to download and use and is approximately 247 MBs.

Step 3:
Once SQL Server express is downloaded an installed, open up ‘Microsoft SQL Server Management Studio’. (Installing SQL Server could easily have a tutorial of its own but for the sake of this tutorial, using the default options should be fine and worked for me).
You will be asked to connect to a server. There should be a database there already in the form <Computer-Name>/SQLEXPRESS. Click Connect to continue.
Step 4:
You will see a list on the left with a folder called ‘Databases’. Right-click on ‘Databases’ and click ‘New Database’.
Give your database a name, I’ve called mine ’sample’, then click OK. ‘Sample’ will appear within the Databases folder on the right.
Right click on ‘Sample’, choose ‘Tasks’ -> ‘Restore’ then ‘Database’. A window will appear with the title ‘Restore Database’. Your Sample database will already be selected on the right. Below this there is a section called ‘Source for Restore’
Choose ‘From Device’ and click on ‘…’ (browse) on the right.
A window will pop up called ‘Specify Backup’. Choose ‘File’ and click ‘Add’ on the right.
Locate the .bak file you downloaded from myLittlebackup earlier and press OK twice to go back to the ‘Restore Database’ window. Make sure you tick the ‘Restore’ box next to the name of the database that has just appeared in the box.
Before clicking ‘OK’, Click on ‘Options’ on the top left of the window, tick the box which says ‘Overwrite the existing database (WITH REPLACE)’.
Now press OK and your database will be imported. You will be able to expand the ‘Sample’ database to see the tables.
Step 5:
Leaving the SQL Server Management Studio, go to Control Panel in Windows. Select ‘Administrative Tools’, click on ‘Data Sources’.
In ‘User DSN’ click ‘Add’ to add a new ODBC source.

Click on ‘SQL Server Native Client 10.0′. Give it a name (eg ’sample_odbc’) and choose a server. It should be the same as the database to connect to in step 4: <computer-name>/SQLEXPRESS. Click ‘Next’
The following screen asks about verifying the login ID. You can leave this screen alone and click ‘Next’.
The next screen is ‘Create a new database source to sql server’. Ensure ‘Change the default database’ is set to the name of your database from step 4. In this case ‘Sample’.
The next screen can be ignored and click ‘Finish’
A window will appear allowing you to test the database source. If there is a problem, repeat the actions in this step 5.
Click Ok to finish the set up of an ODBC source.

Step 6:
Next, open up SQLyog.
When SQLyog opens, connect to your existing mySQL database, probably ‘localhost’
If you haven’t created a mySQL database, create one now by right clicking in the New Connection window on the left and clicking ‘Create database’. Give the database a name eg: ‘New’. This database will appear on the left.
Right click on the database and select ‘Import’ and then ‘Import External Data’.
In the window that opens choose ‘Any ODBC Source’. Below this, select your ODBC connection (created in step 5) called ’sample_odbc’ from the list next to ‘System/User DSN’. Click Next to continue.

The next step is asking where to import the next information to. Ensure your database ‘new’ is selected at the bottom of the window and press Next.
Ensure ‘Copy table(s) from the data source’ is selected in the next window and click Next.
The next window will show a list of tables that can be imported. In my case I know the names of the tables I need so I select them manually. You might want to select the tables manually as there is more information listed in this window than we need to import.
Click ‘Next’ when you have selected your tables. The Wizard will begin copying the table structure and database from the MSSQL database over to your MS SQL database. It could take several minutes. The ‘Next’ button will become available when it is finished.
When the ‘Next’ button highlights, click it, then the ‘Finish’ button.
You have now successfully copied the tables and data from a MSSQL database .bak file in to a mySQL database.
On the left, you can select the ‘new’ database and see its newly imported tables and data.