How can I recover an XAMPP MySQL database from a Time Machine backup?
Success!
Using Back-In-Time, I have copied out an old version of Applications/xampp from the Time Machine backup.
Of note seems to be the folder xamppfiles/var/mysql, which appears to contain folders with names of the databases I had running under XAMPP.
I simply copied the folders corresponding to the databases I wanted to restore to my new machine’s Applications/XAMPP/xamppfiles/var/mysql, restarted MySQL, and was good to go!
Alan H.
Updated on September 17, 2022Comments
-
Alan H. over 1 year
I have a Time Machine backup drive from a MacBook Pro machine I don’t have anymore (technically, I reformatted a while back). It contained a MySQL database installed, managed, and run by my XAMPP for OS X installation (an much older version than the latest).
I’m looking for any and all help recovering that database. Where should I look for what files? How should I recover the data from them?
(Please let me know if I should post this to Stack Overflow instead.)
-
Admin about 13 yearsYou're looking for the Data folder, in which the database file(s) will be stored. If Time Machine ran while the database was in use, there is a chance of corruption due to unwritten pages. You can try pointing your new MySQL instance at the file(s) but there's no guarantee it'll work.
-
Alan H. about 13 years@Randolph The only Data folders that appear to be in /Applications/xampp/ are within "pear" and "perl5" and don’t look like they contain database files (unsurprisingly). Should I be looking elsewhere?
-
Admin about 13 yearsThere should be a data folder for the MySQL installation. If you can't find it, look for a file or folder with the name of the database.
-
Alan H. over 7 yearsInteresting this question has been viewed more than 10K times! Almost no upvotes, though, so it much be appearing in a lot of searches but not really helping anyone, right?
-