LinuxBro
LinuxBro

Reputation: 11

Cloning a database into MySQL

I'm starting a project and we need to develop a tool to look into any database (future goal, currently just Microsoft SQL) and then create and populate a MySQL database with the same tables/columns/data. I've been looking into something like SchemaCrawler to get the DB schema into java objects. I'm hoping there exists a tool to convert those objects into SQL code that I can run against a mySQL server. It would be nice to not have to write a bunch of messy logic using jdbc (My current solution, which is still better than the old solution, an uncommented perl script that converts every column to LONG TEXT).

Upvotes: 0

Views: 87

Answers (1)

Sualeh Fatehi
Sualeh Fatehi

Reputation: 4784

You can use SchemaCrawler's integration with templating languages such as Apache Velocity or Thymeleaf, and develop a template that can generate a DDL script for MySQL. Please download the latest SchemaCrawler distribution, and look at the Apache Velocity example.

Sualeh Fatehi, SchemaCrawler

Upvotes: 1

Related Questions