Reputation: 5471
Ok so I've got phpmyadmin running on my local server for web development, however, my server has crashed, but I have a backup of all the files (not a database backup) on my server from last night, if I copy across the phpmyadmin folder, and put it on another machine, will all my databases still be in tact?
Upvotes: 0
Views: 1234
Reputation:
Your database files are probably in /var/lib/mysql. If you have THOSE files backed up, with EXACTLY the same version of mysql, same libraries, etc., then you could just restore them to another machine, and check the configuration for hostnames (MySQL only uses these IN the database though, for login security, iirc, so it won't apply until you're up and running again). Then, just boot it up. Do keep a copy of the backed up /var/lib/mysql though, in case it fails to come up correctly. MySQL will probably repair some files on startup, which may not work properly.
Once you can do pgrep -l mysql (as root), and you see mysql running, then you can worry about installing a webserver, php, phpmyadmin, etc.
Next time, have proper, regular backups (mysqldump plus a filesystem backup using something like rdiff-backup, dirvish, or faubackup), use a redundant RAID filesystem, and maybe a data-checksummed filesystem on top, like ZFS.
Upvotes: 3
Reputation: 1625
Phpmyadmin is only interface to database engine. You can dump databases trough it, but it is not the database engine. If your server is still alive (ssh or command prompt), and you have live mysql instance you can dump your databases to sql file, using the command mysqldump, and restore them on the new server with phpmyadmin or just using mysql -u user -p | cat sqlfile.sql
Upvotes: 1