Page 1 of 1

DBs from Time Machine backup?

Posted: Sun Jul 03, 2022 6:45 pm
by tonyrambler
Hi all,
running MAMP on MacOS. Accidentally corrupted the DB for a Wordpress site I'm developing. I've been trying all day to bring it back and searching all advice, with no joy. I have a complete Time Machine backup to work from.

The database files are a series of .frm and .ibd files, which I have restored, and also restored the ibdata file.

Can I make a .sql file from these original files and reimport it somehow? Nothing I've tried seems to work, such as directly dropping in the original .frm and .ibd etc files into the MAMP structure.

Any help appreciated!
Tony

Re: DBs from Time Machine backup?

Posted: Sun Jul 03, 2022 8:26 pm
by mampsupportmod
See viewtopic.php?t=132

Basically, if you are restoring from a Time Machine backup that was taken when MySQL DB was live (MySQL was not stopped during backup), restoring won't work because it backed up files in past/future. The link above should fix corruption, but depending on DB sizes, it take sometime. When I had this happen it took my DB's of around 1 gig to rebuild almost a day on a higher end machine. Behavior made most of my sites inaccesible, but slowly MySQL fixed the broken corruption before all sites/DB's worked.

MAMP Snapshots in MAMP PRO are best for now or stop MAMP Pro (Apache/MySQL/etc) and perform a Time Machine backup. I'm hoping MAMP introduces a better auto-recovery method to MySQL doesn't have to be stopped to get full backups.

Good luck

Re: DBs from Time Machine backup?

Posted: Mon Jul 04, 2022 2:57 pm
by tonyrambler
Thanks mampsupportmod. I saw that thread and hoped it wasn't the one I needed!

Well, I just bit the bullet yesterday and rebuilt the site-so-far. I'm now past the previous build stage so it's all good.

Thank you for the advice about stopping the MAMP servers to backup, that's great. I'm doing that now. I'll also do exports from PHPmyAdmin.