database recovery and import

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
    I've been given the job of recovering a database. It's mysql, version
unknown but i'd suspect probably 3 maybe 4 certainly not 5. Apparently the
host provider where this was didn't set up the backups right, because the
guy gave me the db files not database dumps and i am uncertain what to do
with them. I'd like to bring them in to a mysql installation and take a look
at the data contained. If it's valid i.e. what has been requested i'd like
to do a mysqldump on it, then import it in to the guy's database. He says he
wants the entry.db which contains three years worth of nonbacked up data. He
sent me an archive, one of which is a file entry.db so it appears the files
are good, i'm just not sure how to get at them. I've got .db, .db.loc, .idx,
and .idx.loc files so it looks like i've got a complete package. Any

Re: database recovery and import

Quoted text here. Click to load it

Are you sure those are MySQL files?  Those file extensions do not look like

Quoted text here. Click to load it

My suggestions:

1.  Archive the original files somewhere where they can't get clobbered.
For example, CD-ROM.  You may be restoring them to your test system often.

2.  Set up a test system with a guessed version of MySQL which you think
can read this data.  Since MySQL generally can read older data, I'd suggest
the lastest version of MySQL 4.x.  

3.  Shut down the mysqld daemon, install the files in place, and start it
up again.  

4.  Look at the data, with things like SHOW TABLES, DESCRIBE <tablename>,
and SELECT * FROM <tablename> to see if you get sane-looking data.
If you get errors, try REPAIR TABLE or myisamchk.  Be prepared to go back to
step 3, or to step 2 with a different version of MySQL, repeatedly, in case
this just destroys the files because they are not in the right format.

5.  If you seem to have sensible data, run mysqldump to unload it.

Site Timeline