If you have read my earlier experience of moving to WpEngine, I mentioned why I decided to pay $450/month for hosting. One of the best features of WPEngine is, it takes a daily backup of users WordPress blog, and if anything goes wrong, you can restore it. Today, I was working on a normal optimization of the blog, and I used WP-optimize plugin to optimize my database.
As soon as I finished optimizing my database tables, and I opened my blog homepage: It was all blank. All posts were gone, but I knew this is one common error in the database, and it could easily be fixed by repairing the database. I installed WP Db-manager plugin and repaired my blog database. I again checked the database, and all the tables were there, but wp_posts table was showing 0.
I checked the error log file from WPEngine dashboard, and it showed me this error:
WordPress database error Table './wp_shoutmeloud/wp_posts' is marked as crashed and last (automatic?) repair failed for query SELECT wp_posts.* FROM wp_posts
So, Apparently one of my table in WordPress is crashed, which is responsible for storing all my posts, and now automatic repair was also not working. I searched for the solution at WordPress forums, and few blogs and all suggested me to repair the database table via PHPMyAdmin. I quickly installed Adminer WordPress plugin and accessed PHPMyAdmin to repair the database. I could see? Mark in front of corrupted table ‘Wp-posts’. And I tried repairing Wp_posts table from phpmyadmin, but it didn’t helped. I repeated the step couple of times, but nothing worked. And, now I was sure that I had to restore the WordPress from most recent backup.
How I recovered Blog Database using WpEngine Backup?
As I mentioned above, WPEngine hosting takes daily backup of your blog database + wp-content folder. And, from the WPEngine dashboard, you can restore to any backup point. One think which I was not sure if WPEngine takes automatic database backup or not, and luckily they do take the backup.
Tip: If you are taking just database backup of your blog, I recommend you to take daily backup of your WP-Content folder.
If you are a WPEngine user and also got into a situation where you need to restore from last backup point, you can follow below-mentioned tip.
- Login to your WPEngine dashboard.
- Click on the Install Name for which you need to restore WordPress from backup.
- Now click on Backup points from Left column
- Click on Restore, and it will ask if you want to restore the database or not.
- In my case issue was the database, and it’s a good idea to restore both at the same point.
- Now wait for a couple of minutes and your blog will be restored.
In my case I was lucky that I had WpEngine to take my backup, otherwise with the lack of database backup, It would be technically impossible to restore all the posts of ShoutMeLoud. If money is not an issue and you are looking for a quality WordPress hosting, I would recommend you to try WPEngine.
- Check out WPEngine hosting plans (20% coupon: wpe20off)
- Take Daily backup of your WordPress database and WP-content folder.
- Make sure you take a local or on cloud backup of your blog.
- If your hosting company offers account backup, make sure you take advantage of that to create a backup.
- Always take a backup of your database before making any changes.
One good thing about WpEngine is; it asks you to create a restore point before making any changes. For ex: whenever you are installing any new plugin, WpEngine will ask you to create a restore point. This feature is also very useful when you are about to make any new changes on your WordPress blog.
Do let me know if you have ever found yourself in a similar situation where your database is corrupted, or your site seems to be gone?