Wordpress version 3.5 recently got released and just like always, many webmasters are striking their heads against the wall due to newly introduced database errors. Wordpress emphasize greatly to backup your database before making any change but most often we forget to backup and click the Upgrade button in hurry- what follows next is a horrible nightmare for those who are not well versed with MySQL database management and error recognition. I recently got into the same trouble while updating our sister blog i.e. Smart Earning Methods. I forgot to backup the database! Fortunately we receive schedule backups on our Email daily and this was no less than a blessing. The site I updated to WP 3.5, got messed up with plenty of Query errors all pointing to the plugin directory.
- You Might also Like: Basic Tips to Know Before Starting a Wordpress blog
As a PHP developer, fortunately it was easy debugging these errors and restoring the database back to its normal working mode. We would share some tips here that will help you in fixing such errors no matter how big or small your problem be, the tips are enough to put your site back to work even if it gets hijacked or entire database gets deleted or crashed.
1. Always Take Backup of Database Manually
There are several ways to take wordpress backup. The simplest and best way is to do it manually i.e. Through PHPMyAdmin. I never rely on plugins when it comes to Database and I suggest the same for everyone. However for schedule daily backups, I do make use of a plugin called WordPress Database Backup.
To backup your database through PHPMyAdmin there could be no better tutorial then the one given by the Wordpress Folks themselves:
- Read this section: Simple Backup with phpMyAdmin
2. Email the Backup Copy To your Gmail, Hotmail or Yahoo Account
In order to ensure the backup you saved does not get infected while it stays in your hard drive. Its always wise to take two backups and store them on different locations. I normally keep one online using Gmail and one on my hard drive. You can either use the plugin I suggested in step#1 for Scheduling backups to email you the backup file or you can manually email yourself a copy of the backup you saved in step#1.
That's all!
Summary:
*Take backup of your Wordpress Database through PHPMyAdmin and save the same copy both online and offline.
Update Plugins!
Before even visiting your website to see how it looks after the update you must first update the plugins in you installed. Plugins with available updates would be clearly visible in the notification bar. Simply go to Plugins Tab and tick the check boxes next to all plugins and then select update from the drop down menu and hit Apply. All done! Visit your blog site now to see it working just fine. :)
Fighting Plugin Errors
Its very common to see several MySQL errors displaying on your Homepage or Post Pages just after you make the update. This often happens because most Plugins also require compatibility update whenever a new version of Wordpress is released. Most often the developers fail to update their plugins in the wordpress repository. As a result when the new version is rolled out, plugins that aren't updated would fail to function properly and therefore you would see several errors on your screen. These errors look like the following:
Call to undefined function deactivate_plugins() in
/home/xxxx/public_html/xxxxxxxx.com/wp-content/plugins/commentluv/commentluv.php on line 56
The above error occurred for Commentluv plugin. The name of the plugin will be clearly mentioned in your errors and that's what you need to note down. A Plugin error will contain the Plugin string.
Simply not down the plugin name and go to Plugins Tab to deactivate it. Once it is deactivated/disabled visit your site to find it working just fine. Repeat this process for every single plugin that may be causing issues.
Probably this is the worst nightmare for those who often limit backup to database alone. there are two important things to backup when we talk of safety. They are:
1. Backing Up your Entire Wordpress Site
A database only includes your posts, comments, archives, categories, tags and other configuration data. It never saves the following most important media on your site,
- WordPress Core Installation
- Plugins
- Themes
- Images and Files
- JavaScript and PHP scripts
- Static Web Pages
So imagine a webmaster who sleeps peacefully every night thinking he is all safe because he keeps a daily backup of his database but in fact he is the one who is truly shattered when his site gets hijacked by unwelcomed intruders. He may succeed in saving a copy of the database but what about the site's images, JavaScript, PHP and stylesheets which are the rich elements that give true shape and color to the site?
Therefore you must always keep a backup of this rich media on your hard drive. There are several ways of backing up your entire wordpress site. I wont mention them here because there are several tutorials already written on this topic. The best tutorial so far being the following:
Your webhosting company keeps a backup of your site but you are never sure how fresh that backup copy is. Therefore to be on the safe side always run a Site backup at least once a week. It surely take hours to complete even with FTP, depending on your site size! :)
2. Backing Up Database
A database is the collection of all your site records in the form of tables. Its saves your posts, pages, comments, categories and other related data in well organized collections of tables. When you update, delete or insert any stuff in your wordpress site you are only running queries at front end in MYSQL database using your dashboard as the interface.
Backing up database means keeping a copy of all such important information of your site in a safe folder. A Database never contains your site images, stylesheets, scripts or other resources, it only saves text based records of your site.
We already discussed how to backup database manually using PHPMyAdmin.
Are you safe now?
Well if you have a backup copy of both site and database, then of course you can relax and enjoy your cup of coffee even if the site gets hacked by a moron!
Questions?
If you recently trouble-shooted yourself with any such mishap then feel free to post your query below and I would try my best to respond promptly. I just hope your online journey continues without bugs and errors. Happy wordpress 3.5 experience to all. Peace and blessings buddies! :)