In the first part i have showed you a method using csv files but there is
a smarter way to migrate from mysql or mssql , get the column info :name,type,pks http://www.php.net/manual/en/function.mysql-fetch-field.php
after that for each table we can create the table in firebird
1. get tables,get tables columns , types relations from mysql , or mssql (for that i will do an article later)
2. for each table, column create new tables with columns in firebird
3. for each row in each table select from mysql,mssql and insert in corresponding table in firebird
in a similar way we did in previous example but there i have inserted from csv
http://gist.github.com/589903
for mssql i will write another script for info , there is one sp that gives you just that
and we can use one query to get it
Here is the first sub step get all the columns info for one table
Showing posts with label mysql2firebird. Show all posts
Showing posts with label mysql2firebird. Show all posts
Sunday, October 03, 2010
Tuesday, September 21, 2010
Howto and tips :converting from #mysql to #firebirdsql
here are some basic types to be converted from mysql to firebirdsql when you run the create table scripts
dump the database with full inserts and then run it with flamerobin
mysqldump -u root --password=mysql_password -t -c dbname tablename > /tmp/foo.sql
another option is to put dump table in csv format and import it using a php script
that fetches each row and inserts it into firebird table
here is one example for a table with 3 columns
or search for a tool that will do that for you
- int(10)->int
- smallint(5)->int
- datetime->timestamp
- replace the ` with double quote " or with nothing
dump the database with full inserts and then run it with flamerobin
mysqldump -u root --password=mysql_password -t -c dbname tablename > /tmp/foo.sql
another option is to put dump table in csv format and import it using a php script
that fetches each row and inserts it into firebird table
here is one example for a table with 3 columns
or search for a tool that will do that for you
Subscribe to:
Posts (Atom)