Here are 3 ways to prevent yourself from losing your data completely if your web hosts runs away from you or someone accidentally/purposely deleted the files on the web server.
1. Backup, Backup, Backup!
Make a daily backup of all your data daily if possible, both databases and files. If you’re using a database driven application such as wordpress, joomla, drupal or VBulletin, there are already scripts written to automate that task. Or else you might want to write custom cron tasks which grabs, compress and send all your backuped files to an email address or ftp server. WordPress users can refer to my top 10 wordpress plugins post to get the backup plugin.
2. Subscribe to Your Own RSS Feeds
This saved me quite a few times from doing a full database restore. When I saw that there were a few posts and pages which were deleted accidentally by other moderators, all I need to do was to find them from my RSS reader, copy and paste to create the same article with the same content again.
3. Google Cache
Google keeps a cache of the pages that it crawls and indexes (although I noticed that some VERY recently posted articles might not be cached sometimes). If you lost an article and don’t know where else to look, just search for it in Google (site:example.com article keywords) and press the “cache” link under the search result. Note that the search result will probably lead you to a “404 page not found” page since the page is already deleted/missing in the server but the cache link will return you with something useful since it’s served from Google, not from your server.
Unfortunately, it seems like method 1 is the only way to keep your physical data files (i mean jpg, zip, rar, exe, mp3 etc) safe. Unlike text file (such as txt, doc and pdf since Google can crawl and index them) which is easier to recover thanks to the Google cache, you should really take care of how your physical data files are kept and tacked.
Please leave a coment if you have any other ideas for backing-up web server data or any other sources of restoring it if they were lost.