"How to recover from a corrupted or hacked installation."
Main
»
General
»
"How to recover from a corrupted or hacked installation."
There are two components of your software you should safeguard from the event that your install becomes either hacked or corrupted, your database and your files. Routinely make back ups of your database and your files so that should the need arise you can revert back to the last working copy of your software.
A corrupted file can easily be replaced by overwriting the file with a backed up copy of the file. You may need to delete the corrupted file before uploading the uncorrupted file. Ensure that you upload all files in binary format only.
If your install has been hacked then the first thing you would want to check is any folders that have write access. This includes folders such as your cache folder that necessitate the need to be CHMOD to 777. Check these folders for any malicious code and remove them. It may not be enough to simply upload your backed up files over your existing files because it would do nothing to remove any malicious scripts that have been uploaded to these folders. In the event that your install gets hacked you should contact your web server immediately to have them reconfigure your server.
Security accommodations you may have to make include changing your FTP information or your MySQL information. Any information that has been used to compromise your system and allow unauthorized access will need to be looked into by your system admin. If you change your MySQL information then you will need to modify your config files, such as engine.inc.php or authentication_db.inc.php with the updated MySQL information.
You can restore a corrupted or hacked database using a program such as phpMyAdmin. You can do this by dropping your corrupted or hacked database and restoring your backed up database. For this reason it makes sense to make routine backups of your database to minimize the loss of data you would incur if you need to drop and replace your database.