Database recovery

Disaster has struck and your database is in ruins? Don’t despair, recovery is a simple process so long as you have a recent backup file. If you don’t have a recent backup file, then go ahead and despair to your heart’s content.

Generally if your database goes belly up then I’m the first person you want to contact. I’ll happily step in and fix things for you. But for the sake of peace of mind, listed below are the steps I’d undertake to restore your database.

1. Open pgadminIII on your database server. This was installed when you first installed Mandala. Double click on your PostgreSQL server name and enter your postgres user password to open the database server browser. You should see something like this:

2. Right click on the dead database. It will most likely be called “Mandala” – this is the default database name. Select Delete/Drop. It will ask you if you are sure. I know it goes against your IT instincts, but click “yes”.

3. Right click on the Databases tree node and select New Database

4. Type the name of the database you just deleted in the Name field (in this case ‘Mandala’) and click OK. You should see the database in the tree with a red X over it.

5. Browse to the Mandala install folder. Probably C:\Program Files (86)\Mandala, and run MandalaRecovery.exe. You will see the following

6. Click in the very right of the blank area beside Source database. Select your database backup. It will be named something like 15.crypt.

7. Click on Start. [Make sure Restore database is set to False. That option is more trouble than it’s worth and probably should be removed]

8. Now you should have a decrypted database stored at the location advertised onscreen. In this case: C:\Users\David-Win7\Documents\Mandala\OnlineBackups\recovery.backup

9. Close MandalaRecovery and return to pgadminIII. Right click on the newly created Mandala database and choose Restore.

10. Browse to your new decrypted database via the “…” button and then click OK

11. Don’t worry about the single error. It will likely be a red herring designed to raise your blood pressure needlessly. It will probably just be this:

So just remember 0 errors or 1 error is generally OK. More than 1 error is bad. If the process failed, you will probably have 100’s of errors.

12. Close pgadminIII, open up Mandala and log into your restored database – accompanied by a satisfying, inner IT cheer.