Forum Home
Press F1
 
Thread ID: 72614 2006-09-19 09:46:00 copying information between 2 databases Morgenmuffel (187) Press F1
Post ID Timestamp Content User
485768 2006-09-19 09:46:00 Hi all

Is it possible to copy information between 2 databases where the table layouts are completely different

I have 2500 records on one database and i need to transfer it to another database (on the same server/ domain)

I did try CSV download but that had a major problem in that the description fields (stored as a blob) come out as something like this 0x2d20466c69702d746f70206361

I only need to copy some of the table fields from the first database to the second database

Using php Can i have 2 databases open and copy the files between using PHP or is there a better way?

Any help appreciated as this will take a heck of a long time to do manually
Morgenmuffel (187)
485769 2006-09-19 10:02:00 What database are you using?

Using Postgresql I've kept the files that are the source of BLOBs (i.e jpegs) in a folder somewhere with names auch as rec_number.jpg, so I can script (BASH with SQL commands) back in an import if needed. Other data is just dumped as CSV, and re-imported.
gibler (49)
485770 2006-09-19 10:57:00 Both databases are mysql

the blobs are actually just the product descriptions

my current plan is to echo the fields I need out of the first database and write them to a textfile in CSV format

anyway I have to sleep

I have stared at databases for too long today

Thanks all
Morgenmuffel (187)
1