Forum Moderators: open

Message Too Old, No Replies

Restore MySQL Data (folder)

         

l008comm

8:07 am on Jan 14, 2015 (gmt 0)

10+ Year Member Top Contributors Of The Month



Long story short, I kind of hosed my MySQL install. It was 5.6.15 I believe. I upgraded it to the current version, 5.6.22. What I think happened was that the installer package (OS X) didn't stop the server before it did it's thing. I didn't bother to stop it because I figured it was smart enough to know to do that. It was not.

But forget about how I got here, I know it was a dumb situation. I don't have comprehensive backups because this is anything but mission critical data. But now that I might lose it, I do kind of want to keep it.

So what I have is my mysql data folder from 5.6.15. And I have a fully functional install of 5.6.22. I tried swapping the data folders but it wouldn't start up. And there was nothing in the system log for errors, besides "status=0" which is not very helpful.

I've had a little help on IRC but not quite enough to be helpful. It was suggested I could start a new server with the old data, and then export it to .sql files, then import that into the new server. But by that logic, couldn't I just start up the new server with the old data and skip the middleman? Is the situation that the old data files I have will ONLY work inside a 5.6.15 installation, and can't/won't work in a 5.6.22 install?

To complicate things further, one of these databases is about 2 TB in size. I can rebuilt it if I have to, but it takes about 2 months to do so, so I'd rather not if I can avoid it.

jmccormac

11:35 am on Jan 14, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



One very risky possibility is to create an old MySQL install on another box, dump the schema from the affected box/db, use the schema to create the db on the old MySQL install and then shut down the server. Then shut down the server on the new box and copy the database data, format and index files from the new box to the db folder on the old install box. You might have to rebuild the indexes. This might work if you are using MyISAM tables rather than innoDB tables.

Regards...jmcc

lammert

12:03 pm on Jan 14, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Are the old database using InnoDB, MyISAM or something else? Most of the changes between 5.6.15 and 5.6.22 are in InnoDB functionality. With MyISAM you shouldn't run that fast in compatibility problems between the two. Furthermore they changed the encryption library between these two versions from OpenSSL to YaSSL due to the Heartbleed bug.

l008comm

9:34 pm on Jan 14, 2015 (gmt 0)

10+ Year Member Top Contributors Of The Month



So i swapped the data folder again and this time it worked fine, weird. so now im up and running in 5.6.22

lammert

9:46 pm on Jan 14, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Congratulations! Any idea what it was, or just a glitch?

l008comm

9:50 pm on Jan 14, 2015 (gmt 0)

10+ Year Member Top Contributors Of The Month



The only difference is the second time, i moved the data folder rather than copied it, which was a mistake, but somehow it worked that time. Weird.

jmccormac

9:52 pm on Jan 14, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Could have been a permissions issue. Good that it is working now.

Regards...jmcc