File corruption can happen anytime, no matter how hard we try to prevent it. However, it’s important to take measures to prevent damage to a database and ensure that databases are properly backed-up in case of corruption. We will guide you through how to best avoid the need for recovery and prevent file corruption, to keep you working on the tasks that matter.
Why Do Files Become Corrupted?
Before looking at how and why corruption occurs, it’s important to learn how FileMaker Pro manages data. FileMaker Pro is a disk-based application, so it does not require loading the entire database into RAM as the file is opened. The application transfers data from the hard drive to RAM and back; as the file is used, updated data is written from data buffers in RAM to the hard drive.
Unexpected application termination is the most common cause of file damage. In most cases, unexpected damage will occur when the file is between hard-drive updates. In this situation, FileMaker Pro runs a consistency check on the file the next time the database is opened, and the file typically opens without problems. However, if the unexpected closure occurs during a hard drive update, the file is likely to require recovery.
Back-Up Your Databases
Backing up your files on a daily basis is important. A good back-up program should provide several copies of a database as sources for repair. A scheme involving rotating back-ups can accomplish this, as it involves separate back-up copies for at least a two-week rotation. The file is backed-up to a set on the first day, a new set on the second day and so on, until ten sets of back-ups exist. On the eleventh day, the first set is reused for the backup. This type of rotation prevents files from getting damaged. It may be more efficient to use a back-up rather than going through a time-consuming recovery if new data entry has been minimal since the last back-up.
You can choose any available program for routine backups. Using a good back-up program that allows file/folder specific back-ups will provide the most efficient protection of important database files. For very important files, you should store back-ups at an off-site location. FileMaker Server has built-in backup scheduling and should be taken into consideration when sharing mission-critical files.
Save a Clone of Your Backed-Up Files
Since it is sometimes possible to recover only the data from damaged files, regularly saving a clone of a file will guarantee that there is always a database to house your data. Avoid having to rebuild a database; store a clone with your back-ups.
Close All Databases Before Restarting FileMaker Server
When stopping or restarting FileMaker Server processes, databases may not always have enough time to shut down properly before the process is terminated by the OS. Databases can be closed either via the Admin Console or via the CLI using fmsadmin.
Turn Off OS-Level Automatic Updates
OS-level automatic updates can cause the server to reboot without properly closing all files. It is essential to schedule time outside of production hours to manually perform updates to the OS.
Avoid Unexpected Termination
Since unexpected application closure is the most common cause of database corruption, avoiding unexpected termination on the computer from which the file is running is the best way to avoid damaging a database. Since one major cause of unexpected termination is extension conflicts, run as few extensions as possible on the computer on which your FileMaker Pro databases are running. System stability and the number of running extensions are inversely proportional. Public domain or shareware extensions should be avoided in particular.
Commercial extensions are less likely to cause a problem if the most current version of all software is always used. If the file is being used in an area where power outages are a common issue, an uninterruptible power supply (UPS) is strongly advised.
Hard Disk Issues
In cases of several corrupted files on a hard drive, the hard drive itself may be the cause of corruption. Check your hard drive with a disk utility program. Software that optimizes, compresses, or partitions the hard drive should be updated to the latest version. Also, the driver software must be compatible with the System version.
Conduct Routine Maintenance
Apart from regular backups, databases should receive routine compression. Saving a compressed database copy rewrites the entire database, fitting as much data into each block as is possible. This procedure not only regains unused space in the file, but it also rebuilds the file’s structure. Compression can take a lot of time if the file is large, and might be best accomplished as an overnight task.
As the recovery process removes structures that may cause corruption, you may not want to use recovery for routine maintenance. If you do, study and analyze the recovered file carefully to be sure that all objects are intact; objects that are possibly suspicious will be removed.
When to Recover Your Files
In general, you should recover only those files that will not open or are displaying obvious issues with finding and sorting. Keep in mind that there are many situations other than damage that will result in incorrect finding or sorting, including mismatched field types, and you may want to examine these other possibilities before you recover a file.
Make Changes in a Clone of the File
Any time you make changes to a file, like field deletions or modifications, always work in a clone of the database and import your data after the design work is done. The importance of using a replica for design modifications increases as the database size grows. Use the latest revision of your version of the application.
Avoid the Need for File Recovery with FileMaker Pro
Regular back-ups are the only guarantee of database safety and, when necessary, using the FileMaker Pro “recover” command to protect and recover your corrupted data. Avoiding file corruption is a challenging task, but with the correct use of the FileMaker Recovery Tool and a few preventive measures, you can greatly minimise the chances of file corruption and repair your corrupted files.
For custom FileMaker solutions, tailored entirely to your company and the demand of your business, Check out our fmLifeBoat solution to learn more and get in touch. We are always ready to help your team with a custom-made workflow system for your industry needs, helping you elevate and accelerate your working process.