Today’s operating and file systems are robust, but, still, they do fail. So, it can happen that also a DEVONthink database becomes defective for whatever reason. So, here are some tips on how to keep your database healthy:
- Run Tools > Verify & Repair regularly.
- Use Tools > Backup & Optimize from time to time to create a copy of the index files and to clean up internal structures.
- Make sure to set your backup options in Preferences > Backup to your needs; this function creates copies of the index files inside the database package in case that the index gets corrupted.
- Backup your database to a safe place; use the Scripts > Export scripts to export all your documents into the file system and store it to an external hard disk, DVD-R, or your iDisk.
But what can you do when Verify & Repair reports an error? Follow these steps:
- Don’t Panic. Except for text and markup files all documents are stored as regular files inside the database package/folder. So even when DEVONthink completely fails there is a good chance that you can retrieve most of your data.
- Close DEVONthink and create a copy of your database package in the Finder just in case something goes wrong with the next steps; if you’re running DEVONthink Personal, make a copy of ~/Library/Application Support/DEVONthink (where ~ is your home directory).
- Run Tools > Verify & Repair again.
- If it fails again, try to go back to one of the internal backups using Tools > Restore Backup… This is non-destructive and simply swaps the backup index with the current one. Run Tools > Verify & Repair on the backup index and if this also fails, try all the other backups.
- Should all internal backups be corrupted, too, rebuild the index from scratch: Tools > Rebuild Database…
- Finally, if this also fails, it’s time to find your last backup DVD, get your external hard disk, or open Time Machine and replace your defective database with your last full backup.
If even Verify & Repair crashes (and so also Rebuild Database) and your database is extremely large (more than 50 million words) you may succeed by exporting half of your documents to the file system by using ‘File > Export > as Files and Folders’ and deleting them for the database before trying to repair it again. Mac OS X’s memory management is known to crash applications in tight memory conditions when a lot of memory is requested and moved between RAM and hard disk.