Importing .bak from MSSQL into MySQL database - mysql

My companies site uses a mysql database. One of our clients just trying to take advantage of our API is only able to give us the data in the form of a MSSQL .bak file
I have been trying to import the file using the migration tool built inot mysql workbench but have no luck.
On top of that I am trying to see if this can be done in powershell as I would like to automate this process in the future.
Any suggestions or help would be appreciated

You cannot. MS SQL Server backups are proprietary to MS SQL Server and cannot be used with any other RDBMS. You will need to restore this backup to SQL Server, then use an additional tool to transfer the data from SQL Server into MySQL.
Can you do that second portion through PowerShell? Probably. Though SSIS would probably be a better method.

Related

Create MySQL database from .mdf and .ldf files from SQL Server 2008

I have some .mdf and .ldf files of database size greater than 10 GB with me.
I want to create a MySQL database using the same.
Is there any provision in MySQL to do it?
Please consider that MySQL and SQL Server 2008 can not be installed on the same machine (or even the same network) in my current setup.
I don't have enterprise edition of SQL Server management studio in our network and will not be able to install it.
Is there any other elegant way to export data from SQL Server 2008 and import it in MySQL?
I don't think it is possible without attaching.
If you find a way how to attach it, you can use some specific migrating tools like this.
Some tools allow to create database specific queries from another solution, that need to be only executed on your side.
The MDF and LDF files belong to Microsoft SQL Server and use Microsoft's own binary format, so you cannot connect these files to other database management systems. The only approach I can think of, is to script out the database code and data from the SQL Server database to a text file (.sql file), and import this file into MySQL.

How to migrate large amount of data from MySQL database to SQL Server database with C# service

I have a MySQL database contains large amount of data.
I wanted to write a C# service program to migrate that data into SQL Server database.(Service should work fine with Insert as well as update with out performance issue).
Please help us if there is a way to accomplish this. If there is another way to achieve this is also fine. But, the MySQL client is not present in the local machine. But we could access the database from the server.
You can use the import and export functions in sqlserver, after installing a odbc mysql

Convert Azure SQL to MySQL

I'm a fairly new developer working on a database for a university research project. I created the database in Microsoft Access then used the SSMA Access to SQL migration tool to export it to Azure SQL. I'm now building a Ruby on Rails implementation of the databases front end on a Debian VPS and would like to migrate the Azure SQL database to MySQL for testing purposes with a view to eventually converting all of the database front ends to connect to the MySQL database.
I've been able to find plenty of articles discussing moving MySQL to Azure SQL but very little which details the process in reverse. Any and all help would be appreciated!
Thanks,
Mike
Mysql allows you to import full database dumps (table definitions and content) as long as they are in sql format, in a text file.
As long as you manage to generate a dump of your database as a text file of sql statements you should be ok.
The only thing is azure may not give you the chance to generate that dump.
But you'll probably have third party tools that will allow you to.
If not, since you initially built you database in access you will for certain find free tools to do a access to mysql migrations. (a quick google search shows me bullzip and mdbtools as two free tools that do just that.)
Once you have your sql dump file just import it into mysql from the command line or using the source command in the mysql client.
Wouldn't it be better to write code that is database agnostic. That is your code shouldn't care what database you are using

Convert a .bak file to .sql file

I have a asp script that I'm intending to write it with PHP so I have to get its database and use it.
I have the database as .bak file which I understood that it's a backup and I wanna change it to be .sql to import it in phpMyAdmin
I read about this matter in the web but I didn't find an accurate tutorial that goes through the whole process.
They are talking about mssql database but I didn't even reach this step..
Any help will be highly appreciated. Thanks in advance :)
Note, all of this applies to MS SQL because .bak is a usually a MS SQL backup.
A .bak can't be converted to SQL directly -- it contains a backup of a database which does not have a clear relationship to SQL.
You could restore the backup and then use SQL Server tools and then use that to make some SQL to recreate the SQL server objects but not the dat.
From SQL Server Management Studio: Datbases item, right click "Restore
Database" then from datbase right click script database.
This won't script the data.
The other option is to use RedGate's excellent tools, which should do everything you want.
http://www.red-gate.com/products/sql-development/sql-toolbelt/
Most probably the .bak file is indeed a binary backup of a Microsoft SQL Server database (which is something completely different than MySQL).
So you will first need to install Microsoft SQL Server (Express) together with the SQL Server Management studio (I think there is a bundled download "SQL Server Express including Tools".
In the Management Studio you can then import the .bak file into a new database. Once the import is finished you can use it to create SQL script out of the database.

Databases: Migrate data between MS Access DB and MYSQL

I have 2 databases, one is MS Access DB from an old website, and the other one is MYSQL from the new Joomla+VirtueMart based website.
I need to migrate existing products from MS Access to MYSQL.
I thought of putting both on server and writing SQL queries in MYSQL workbench, untill I have a good script for that, but I'm very new to SQL, so I'd rather avoid that.
I there a better way and more efficient for that?
You can always export to CSV and import that in MySQL.
you can use tools like Database Workbench
MySQL provides a free graphical tool called "MySQL Migration toolkit" which automates the migration of Access 2003 MDB files (schema + data) into MySQL.
More info at the following link:
http://www.mysql.com/why-mysql/white-papers/a-guide-for-migrating-from-microsoft-access-to-mysql/
(you need to register with Oracle to download the PDF guide).
Here's another link using the ODBC technology
https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-examples-tools-with-access-export.html