Bluehost.com Web Hosting $6.95

Conversion of a dump file

This is a discussion on Conversion of a dump file within the MySQL Database forums, part of the Database Forums category; I've inheritied a mysql dump from a 3.23 database. The appliance I'm supposed to reload it on ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-12-2006
Keith
 
Posts: n/a
Default Conversion of a dump file

I've inheritied a mysql dump from a 3.23 database. The appliance I'm
supposed to reload it on is a 4.1 mysql database. it's bombing out on
me, which really doesn't surprise me. However, I'm wondering if there
is a script out there that will go through and check the syntax of the
..sql file and convert any 'non 4x' statements into something that 4.1
can understand and like.

It's not a giant DB, it's about 250kb - but that's a lot of flat text
to have to go bumbling though.

thanks,
-Keith

Reply With Quote
  #2 (permalink)  
Old 12-13-2006
Gordon Burditt
 
Posts: n/a
Default Re: Conversion of a dump file

>I've inheritied a mysql dump from a 3.23 database. The appliance I'm
>supposed to reload it on is a 4.1 mysql database. it's bombing out on
>me, which really doesn't surprise me. However, I'm wondering if there


A dump from 3.23 should be largely compatible with 4.1, but one
area where it may not be is in the use of field names or table names
which have become keywords. What specific statement does it bomb
out on? Find the statement (and which line of the statement, if it's
on more than one line), and examine the field and table names.

>is a script out there that will go through and check the syntax of the
>.sql file and convert any 'non 4x' statements into something that 4.1
>can understand and like.
>
>It's not a giant DB, it's about 250kb - but that's a lot of flat text
>to have to go bumbling though.

Reply With Quote
  #3 (permalink)  
Old 12-13-2006
Axel Schwenke
 
Posts: n/a
Default Re: Conversion of a dump file

"Keith" <keith.phipps@gmail.com> wrote:

> I've inheritied a mysql dump from a 3.23 database. The appliance I'm
> supposed to reload it on is a 4.1 mysql database. it's bombing out on
> me, which really doesn't surprise me. However, I'm wondering if there
> is a script out there that will go through and check the syntax of the
> .sql file and convert any 'non 4x' statements into something that 4.1
> can understand and like.


AFAIK no such script exists yet. Maybe you want to write one? ;-)

You can solve your problem by installing MySQL 3.23 on a spare machine
and load the dump there. Then dump it again with the mysqldump program
from 4.1. Newer mysqldump understands the --compatible option.

i.e.

hostA> mysql test <old_dump.sql
hostB> mysqldump -h hostA test >new_dump.sql


XL
--
Axel Schwenke, Senior Software Developer, MySQL AB

Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/
MySQL User Forums: http://forums.mysql.com/
Reply With Quote
  #4 (permalink)  
Old 12-14-2006
Mike Lischke
 
Posts: n/a
Default Re: Conversion of a dump file

Keith wrote:

> However, I'm wondering if there
> is a script out there that will go through and check the syntax of the
> .sql file and convert any 'non 4x' statements into something that 4.1
> can understand and like.


Hmm, sounds like a perfect job for MySQL Query Browser. Load the script
in the script editor and run it. The tool will stop at the position
where the error occurs. You can set break points to have the script run
holding while you examine your data in another tab (with a result set).

Of course you can conveniently re-run your script or delete anything
that ran successfully, instead of starting over all time.

Mike
--
www.mysql.com
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 03:24 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0