Montag, 30. Dezember 2019

Fix corrupt MailStore Home Database

If you get errors about data corruption when starting up MailStore Home, here's how you can fix it.

MailStore uses a Firebird Database for storage. Luckyily Firebird includes tools to repair databases. Lets get them here:

https://firebirdsql.org/en/server-packages/

Version 2.5 worked for me for Mailstore 11.2. On newer versions of MailStore you might want to try a later version.

This guide was perfect for the repair run
https://www.ibphoenix.com/resources/documents/how_to/doc_5

Notice: You'll need to add the switches to access and to restore the databases.
 -u SYSDBA and -p masterkey

Before you start, backup your corrupted database MailStoreFileGroup.fdb.
This is what I ended up doing:

(1) Fix the errors

gfix.exe -m -f -i -user SYSDBA -password masterkey MailStoreFileGroup.fdb

(2) Backup the database
gbak -b -v -i -user SYSDBA -password masterkey MailStoreFileGroup.fdb backup.fbk

(3) Restore the database
gbak -create -v -user SYSDBA -password masterkey backup.fbk MailStoreFileGroup_reborn.fdb

Finally, replace the MailStoreFileGroup.fdb by MailStoreFileGroup_reborn.fdb