All blog owners know the importance of backups but it can happen to forget to make regular copies.
Often we realize the importance of the backup when it is too late, ie when it would be very useful to have the data to retrieve.
There are loads of plugins available to copy your blog. Install your favourite backup plugin as soon as possible. You will lose ten minutes to setup and configure it but will save time and stress at the right time.
Below the steps I made to restore a wordpress backup.
I'm talking about a Wordpress 3.2.1 running on a cPanel hosting platform .
I accidentally deleted the entire wordpress database. I've gotten this error : "error establishing a database connection " .Although it may seem like the worst possible situation, perhaps it is more difficult retrieve only parts of a database.
Duplicate the backup file. At this time the backup file is essential.
etrieve some essential information from the file wp-config.php. Open the file with a text editor and take note of these 3 settings:
Using cPanel database administration tool :
Create a database named as in DB_NAME.
Create a user named as in DB_USER, with password as in DB_PASSWORD
Associate now the new user to the new db and give it all rights.
Now that we have an empty database with the right settings, we can repopulate the data using the backup file.
Using PhpMyAdmin tool : Position yourself in the newly created database by selecting in the left column. The program will warn you that there are no tables in the database.
Click on the "import" item at the top right . This will open a page where you can load our backup files, either in Sql format or in a compressed format.
Usually the other values can be left set to default values.
Confirm the operation by clicking the Import button at the bottom of the page.
At this point your phpMyAdmin should show the repopulated tables in the left column
You can close PHPMyAdmin, cPanel and try to get in your blog. You have lost the changes since the last backup , but the blog is now up and running again.
This was just one possible scenario, probably the simplest, and certainly there are other ways to recover data lost. I think anyway this simple article can be useful even just as a list of steps needed to be done to then adapt it to your situation.