I recently helped a client recover a WordPress website that had been deleted by their hosting provider. The provider claimed it had been hacked, or otherwise compromised, and had simply deleted it with little or no prior warning or notification. The client didn't have any backups -- they had been relying on their provider to keep backups; backups which were apparently dumped when the compromised site was removed.
This client had originally developed their site in a MAMP environment on their personal MacBook — MAMP is a website development environment, including a web server and database, that runs on an Apple MacOS or OSX system. They wanted to restore the website to the state it had been in when it was initially installed at their hosting service.
The MAMP environment had not been used for some time and was no longer functioning on the MacBook. However the WordPress files were still on disk as well as an archive the the database as it existed when MAMP last ran.
It was at about this point that I was brought in.
The first thing we checked was whether or not the hosting provider had also removed the database used by the WordPress site they removed. If it was intact, restoration would be much faster as we would only have to worry about installing the files from their local MAMP area. Naturally, the provider had removed the database as well.
So, starting from scratch at the hosting provider's cPanel, we used their Application Manager to install WordPress in the hosting environment — This is a quick way to install the WordPress core files and also create the new database for it to work with.
We then used the cPanel File Manager to upload just the wp-content folder from the client's MAMP files, replacing the wp-content directory of the new WordPress installation on the hosting service. The wp-content directory contains all the uploaded images as well as themes and plugins used by the WordPress installation.
Next, we used phpMyAdmin from cPanel to import the database archive from MAMP. This was probably the trickiest step as the archive had to be edited to use the new database name. We also had to make a few other edits to correct minor version differences between the MySQL that had been used in MAMP and the one currently in use on the hosting server. And finally, we performed a global search-and-replace of some URL's because the new WordPress installation was in a different subdirectory than the original MAMP installation had been in.
Once the database was importanted, we logged into the website's dashboard, prompting WordPress to update the database structure to that used by this latest core release.
Success! Everything, as it had last been in the MAMP environment, is now successfully restored to their hosting service.
Next steps will be to setup regularly scheduled backups that will be automatically stored at a remote location or emailed to the website owner. We'll also help them setup some basic security, so this situation will hopefully never reoccur. But if it does, the off-site backups will make the next recovery much faster and easier.