Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-13-2012, 01:26 AM   PM User | #1
syco__
Regular Coder

 
syco__'s Avatar
 
Join Date: Oct 2005
Location: Australia
Posts: 178
Thanks: 39
Thanked 3 Times in 3 Posts
syco__ has a little shameless behaviour in the past
MyISAM database transfer

Hey guys,

not sure if this is the right section if so can it please be moved. Anyway here is my situation.

A client had a previous website up with a blog that was wordpress i have re-created the entire site in another wordpress database and forgot about the posts from the previous one. The website has since been redirected to the new site i still have FTP access to the old site i just cant get into the wordpress to do an export i can only do it via the phpMyAdmin panel that i know of and this is where the problem comes in the old database is of type MyISAM and the new one is of type InnoDB and will not allow me to simply take the wp_posts and put it in the new one.

Is there a way i can convert it so i can use it in the new database?

Thanks,

by the way if you are unclear of my problem still let me know and i will try and explain it better for you.
__________________
.pLeAd InSaNiTy.
syco__ is offline   Reply With Quote
Old 10-13-2012, 01:36 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,556
Thanks: 62
Thanked 4,055 Times in 4,024 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
One easy thing to do: dump the old one, getting the dump as MyISAM.

On the new site, create a TEMPORARY database and import the MyISAM tables to *THAT* database. [If the dump file from the old DB specifies the database name, just use an editor to change it in the dump file.]

Now just construct a query that will copy the data from the temp database table(s) into the InnoDB tables in the main database.

Might be tedious if there are lots of tables and lots of fields, but probably lees work than any other way.

When done, you can just drop the temp database.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 10-13-2012, 01:37 AM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,556
Thanks: 62
Thanked 4,055 Times in 4,024 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Should have mentioned that I don't use phpmyadmin...I just do it all from command line. So I don't know what restrictions phpmyadmin imposes on you.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 10-13-2012, 02:14 AM   PM User | #4
syco__
Regular Coder

 
syco__'s Avatar
 
Join Date: Oct 2005
Location: Australia
Posts: 178
Thanks: 39
Thanked 3 Times in 3 Posts
syco__ has a little shameless behaviour in the past
I dont have access to all the files till monday but i did try this but it just kept give me a error at like x saying wrong syntax saying something about TYPE = MYISAM i cant remember the exact line i will check when back at work. But i tried editing the file and just replacing the MYISAM with innodb but still same error same place.

Thanks for you reply i will try this process again
__________________
.pLeAd InSaNiTy.
syco__ is offline   Reply With Quote
Old 10-13-2012, 03:50 AM   PM User | #5
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,556
Thanks: 62
Thanked 4,055 Times in 4,024 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Ahhh...it is possible that the MySQL installation you are trying to import into doesn't support MyISAM. That's a possible but seldom used option when installing MySQL.

SO that would explain the inability to import MyISAM, at all.

Doesn't explain why changing from ENGINE=MyISAM to ENGINE=INNODB didn't work, unless you have data integrity problems the MyISAM ignored (as it almost always does) where INNODB choked on them.

For that, I'd need the complete error message to hope to diagnose the problem.

************

Perhaps a better approach would be to create a temp database on the *OLD* system and create the tables in that temp DB as INNODB. Then use SQL to copy the data from the MyISAM tables to the temp DB's INNODB tables.

If that works, then dump the temp DB tables and import them.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:49 AM.


Advertisement
Log in to turn off these ads.