Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting Data From One DB to Another

Status
Not open for further replies.

PulsaMatt

IS-IT--Management
Apr 25, 2002
151
US
Hi, I Am looking to try to convert the data that is in a current database into the new structure I designed for Version 3 of the application I am building.

I have been trying to write simple VB scripts to do the conversion for me, but they keep crashing at odd points due to some issues (namely in Version 1 people could use single quotes, in version 2 you couldnt but you could use double quotes) so both record delimiters that I know of ' and " are out of the question .... any ideas on how I Can do this?

For the most part its a straight old field to new field conversion but there are a couple fields where I need to combine and reorder data to make the new field (The results of me learning this as I go along).

Any help is GREATLY appreciated :).

Matt Laski
Sysadmin, Pulsafeeder Inc.
 
I am not sure I understood what you want to do but if it is only a record delimiter problem have you tried TAB, |, and others?

Mysqlimport utility is very flexible.

If I did not understand correctly, please post a sample of your data and tell us exactly what you are trying to achieve.


Bye

Qatqat

I have been happy throughout my life in thinking that samba was I kind of dance; now I live with Linux and all I do is working.
 
How do you go about using a pipe ( | ) as the field separator? I tried doing it and mySQL had a bit of a hissy fit about it.

Would mysqlimport allow me to move data from a table in database A to a table in database B while allowing me to manipulate some of the data to fit into database B? I am combining some date fields with some time fields to make datetime fields ... made some newbie errors in the original database that I Am trying to fix.

Thanks :)



Matt Laski
Sysadmin, Pulsafeeder Inc.
 
MySQL is fine about accepting pipe


mysqlimport -L -h hostaddress -u username -ppassword --field-terminated-by=| --fields-enclosed-by=' DatabaseName file_to_import.txt

The above script will import a txt file with all fields delimited by | and enclosed by '


If you instead have got a MySQL DB to export then you have to use MySQL export utility which is not free.

You can find it t


I would anyway use the mysqldump utility to export databases from MySQL to MySQL

mysqldump -u root -ppassword DBname > /path/file_name.sql


Bye

Qatqat

I have been happy throughout my life in thinking that samba was I kind of dance; now I live with Linux and all I do is working.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top