KB06071801 Recovering from Database corruption (AFV)This KB Article refers to the AFV Database
Method 1 - Recovery with access to a valid backup It is strongly recommended that you have a backup routine so that you have backup to hand should you ever need it. Mailtraq Professional users should use the online backup system built into Mailtraq. You can read about creating a backup/restore regime here
Mailtraq Essential and Mailtraq Professional users using the 'manual' backup method should use the following procedure: To use a recent backup:
- Shut down Mailtraq
- Locate the Database folder.
The Default location is C:\Program Files\Mailtraq\Database but it may be located in a custom location. - Rename the Database folder to Database-old
- Copy your backup Database folder into place.
- Restart Mailtraq.
Mailtraq will now be running exactly as it was when the last backup was done.
See also: KB06071802 Repairing a corrupted Firebird database & KB08040101 Repairing a corrupt AFX 'mailbox'
Method 2 - Recovery without access to a valid backup It may not be possible to fully recover from a corrupted database without access to a valid backup, however the following procedure will allow you recover as much as possible. You should consider how to prevent new mail from routing whilst you perform the recovery. Mailtraq should be isolated form the mail flow. The method used will differ from installation to installation - could could consider changing the machine name and IP address temporarily, changing the NAT settings on the router, disconnecting from the network or other appropriate methods. Step 1 - Damage Limitation As soon as you become aware of corruption: - Use the Tools | Backup Configuration to capture the current Configuration of Users, Mailboxes and Routes.
- Shutdown Mailtraq and take a copy of the Database folder. The Default location is C:\Program Files\Mailtraq\Database but it may be located in a custom location. Save it to a safe place. This will provide you with a reserve data structure.
Step 2 - Create a shadow installation - Obtain a new download of Mailtraq from your account at https://my.mailtraq.com and install it on another machine on your network: be sure to select the same Database type as your existing installation. This is within the terms of your license.
If you need to get a download of an old version of Mailtraq to follow the 'shadow' install process you can do so from this location: https://my.mailtraq.com/builds.asp
- Do the minimum to complete the installation procedure - do not use the Installation Wizard
- Use the Tools | Backup Configuration to capture the current Configuration of Users, Mailboxes and Routes.
- Shutdown Mailtraq.
- Locate the Configuration folder you just created. It will be here: C:\Program Files\Mailtraq\database
- Copy the Configuration folder you created on the 'old Mailtraq' to the same location.
- Restart Mailtraq
- Use Tools | Restore Configuration to use the Configuration you imported. The wizard will instruct you to shutdown and restart Mailtraq.
Your new Mailtraq will now be configured with your Users, Mailboxes and Routes but will have no knowledge of any mail stores. Step 3 - Import Messages - Use the Export Messages tool to export messages from the old Mailtraq - mailbox by mailbox. Read how here ...
- Use the Import Messages Wizard to to import those messages into the new Mailtraq.
Step 4 - Restore Mailtraq to the original machine - Shutdown Mailtraq
- Copy the entire Database folder from the temporary Mailtraq machine to replace the Database folder on the old machine.
- Restart Mailtraq
More information for Firebird users Mailtraq stores the message routing and configuration separately from the message store. It is therefore possible to abandon a corrupted database and start again. Shut Mailtraq down, rename the mailtraq.fdb file to mailtraq-old.fdb, and then restart Mailtraq. Mailtraq will create a new empty database and continue to route messages following the existing configuration. Extracting messages from a corrupt Firebird database Problem: You have a mailtraq.fdb database file that holds messages you need to recover, but when you attempt to search you get no results. This indicates corruption, however it is likely that the corruption only affects a small proportion of the FDB file. This method allows you to extract all the recoverable messages from the database and place them in one AFX file for importing into a current version of Mailtraq. You will then be able to search the new AFX file to recover the messages. Method Mailtraq must be shut down and you should work on a copy of the mailtraq.fdb file Locate the folder containing the (copy) mailtraq.fdb Download http://resources.mailtraq.com/files/fdbutil.zip ...unpack it all, including its .dll files, into the same folder. To get all the messages available into an .afx file, you do this: at a DOS command prompt from inside that folder enter the following command: (remember you will need to CD to get there) fdbutil -d mailtraq.fdb -df mailtraq.afx And all available messages in mailtraq.FDB should be put into a new file called mailtraq.AFX You will then need to import from the mailtraq.afx like this www.mailtraq.com/import |