Scott Caudle
Scott Caudle

Reputation: 19

how to restore PHPMyAdmin databases?

So I was updating to the latest version of AMPPS and I accidentally deleted all of my databases that were on the previous version of AMPPS. However I do have a backup of the old version of AMMPS saved on a hard drive. How would I go about restoring all the old databases into the new version?

Upvotes: 0

Views: 760

Answers (1)

Isaac Bennetch
Isaac Bennetch

Reputation: 12422

You might be able to completely replace the MySQL data directory in order to restore your files. You should not try to replace only certain files/folders, so this will completely wipe out anything in your current/new database.

You'll have to find the data directory, so from the command line client or phpMyAdmin's SQL tab enter the query SHOW VARIABLES LIKE '%datadir%'; (you could also use the phpMyAdmin 'Variables' tab to find this). I don't use AMPPS, but on my Linux system this gives me /var/lib/mysql/.

Next, completely stop the MySQL service. I have no idea how to do that in AMPPS; I presume that there's a control panel/center like most of the other *MPS packages where you can start and stop individual services.

Now, remove the new datadir folder and replace it with the one from your backup. Keep a copy, of course, in case anything goes wrong.

Finally, start the MySQL service again. If everything went well, you'll be back to normal.

Upvotes: 0

Related Questions