OpenAI advertising measurement

    Allow OpenAI to measure page views and completed contact requests, including a hashed email address and, when available, a hashed customer ID from your contact record for matching? The contact form works either way. Your choice applies only to OpenAI advertising measurement. Privacy notice

    Change this choice any time using Advertising measurement settings in the footer.

    Emergency TriageExperiencing system crashes, corrupted TPS files, or sudden developer departure?
    Back to Blog
    Data Protection

    Why Clarion TPS Files Get Corrupted and How to Protect Your Data

    Why Clarion TPS Files Get Corrupted and How to Protect Your Data

    If your business runs on a Clarion application that stores data in TopSpeed (.TPS) files, those files are your business records: customers, orders, invoices, inventory, history. When one becomes corrupted, the effects can range from an odd error message to a program that will not start.

    Good backup and maintenance habits can reduce the risk of corruption, and some damaged files can be recovered when they are handled carefully. The most important rule comes first, so here it is: make a safe copy of your data before you try any repair.

    What a TPS file is, in plain terms

    A TopSpeed file is a single file on disk that can hold a table's records along with its indexes (called keys) and, in many cases, memo fields. Several people can use the same files at once over a network, and the program is constantly reading, writing and updating those indexes as people work.

    That constant activity is the point where things can go wrong. If a write is interrupted halfway, the data and its index can disagree about what is in the file. That disagreement is what people usually call corruption.

    Common causes of TPS corruption

    Corruption rarely has one dramatic cause. It usually comes from ordinary events that interrupt a write at the wrong moment:

    • Power loss or hard shutdowns. A workstation or server that loses power while the program is writing can leave a file half-updated.
    • Workstation crashes and force-closed programs. Ending the program through Task Manager or restarting a frozen PC while it is saving has the same effect.
    • Network problems. Wi-Fi connections, flaky network cables, failing network cards, switches or unstable VPN links can drop a connection mid-write. Programs using shared TPS files generally work best on a stable, wired local network.
    • File sharing and caching settings. Settings on the server or workstations that cache or delay file operations have been known to cause trouble with shared data files. These are worth reviewing with someone who understands both your network and your program, rather than changing them at random.
    • Security and backup software touching live files. Antivirus scans or backup jobs that read or lock data files while people are working can interfere with the program.
    • Failing disks. A drive developing bad sectors can damage files regardless of what the software does.
    • Copying or moving files while the program is open. A copy of a file taken mid-use can be inconsistent, and so can a file moved by someone who did not know it was in use.
    • Running over a wide-area connection. Opening a TPS data folder across a slow or unreliable remote connection raises the risk considerably.
    • Mismatched program and data versions. Running an older or different build of the program against data that has been changed by another build can cause errors.

    Warning signs to take seriously

    Corruption often announces itself before it becomes severe. Watch for:

    • File system or "invalid key" style error messages when opening a screen or running a report.
    • Records that appear in one view but not in another, for example a customer who shows up in a search but not in the main list.
    • Lists or reports that show duplicates, skip records or sort in the wrong order.
    • Browse screens that freeze or take far longer than usual to load.
    • Totals that do not match from one report to the next.
    • Crashes that happen at the same point in the same screen.
    • A data file that has suddenly grown or shrunk by a surprising amount.
    • Reports from users that the program "acts funny" after a power cut or network outage.

    One odd message does not prove that a file is damaged, but several signs together deserve prompt attention. Problems tend to get worse the longer people keep working in a damaged file, because new entries can be written on top of inconsistent data.

    If you suspect corruption: what to do first

    When something looks wrong, the order of your actions matters more than their speed.

    1. Stop using the program. Ask everyone to close it, including anyone connected remotely. Continued use can spread the damage.
    2. Do not run repair tools yet. Utilities that rebuild keys, pack files or reclaim space change the file. If something goes wrong partway, the original state may be gone.
    3. Copy the whole data folder to a safe place. With the program closed on every machine, copy every .TPS file (and any related data files the program uses) to a separate disk or location. Label it with the date and time and treat it as read-only.
    4. Make a second copy and work on that. Any recovery attempt should happen on the second copy, never on the preserved original or your only live copy.
    5. Locate your most recent good backup and note its date. Knowing the gap between that backup and today tells you what work might need to be re-entered if recovery falls short.
    6. Write down what happened. Note the error messages, which screens were affected, and any power or network events. This helps whoever investigates.

    Recovery: what is usually possible

    Depending on the type and extent of damage, there are a few general approaches. Which one fits depends on the situation, and a wrong choice can make matters worse, which is why they should be done on copies.

    • Rebuilding indexes. If the records are intact but the keys are damaged, rebuilding the keys can restore normal behavior.
    • Using the repair utilities provided with the Clarion tools. Utilities exist for checking and repairing TopSpeed files. They are best used by someone who understands what each option does, and always on a copy.
    • Exporting what can be read and re-importing it. Sometimes the usable records are extracted from a damaged file into a fresh one.
    • Restoring from backup and re-entering recent work. When damage is severe, a good backup plus re-entry of recent transactions can be the safest path.

    After any recovery, verify the results before returning to normal use. Compare record counts and key totals with the last good backup or printed reports, spot-check recent transactions and let a few experienced users test the screens they rely on.

    Backups: your real protection

    Recovery tools are a last resort. A good backup routine is what keeps corruption from becoming a crisis.

    • Back up when the files are not in use. The simplest safe method is a scheduled copy after hours, when everyone has closed the program. Backing up files while they are open can capture an inconsistent copy.
    • Keep several generations. Do not overwrite yesterday's backup with today's. If corruption goes unnoticed for a few days, you need an older copy that predates it. Keeping daily copies for a couple of weeks plus periodic older copies is a common approach.
    • Store a copy off the machine and off the site. A backup on the same server disk disappears with the server. Keep one copy elsewhere, such as an external drive that is rotated, or secure cloud storage.
    • Back up the program too. The executable, supporting files, configuration, and any source code you have should be included, not just the data.
    • Test a restore. A backup you have never restored is a guess. Periodically restore a copy to a separate location and open it to confirm the data is usable.
    • Check that backups are actually running. Look at the log or the file dates every so often. Silent backup failures are common.

    Prevention habits that help

    • Use a battery backup (UPS) for the server and key workstations so that a power cut does not interrupt a write.
    • Run workstations over wired network connections rather than Wi-Fi where you can.
    • Ask staff to close the program properly at the end of the day instead of switching off the PC while it is open.
    • Keep the program and data in sync: make sure everyone runs the same build of the program.
    • Have your server's file-sharing and antivirus settings reviewed by someone familiar with legacy data files, instead of changing them blindly.
    • Monitor disk health and free space on the server.
    • Do not use the data over remote connections that are not designed for it. If remote access is needed, a safer approach is to connect through a bridge or remote desktop session rather than opening the data folder directly.
    • Arrange for regular maintenance by someone who understands your program, rather than waiting for a failure.

    Every business has a different setup

    How your files are stored, which version of the program you run, and the layout of your network all affect what is safe to do. Some Clarion programs also use a different type of database instead of TPS files, in which case the advice above applies differently. When in doubt, preserve a copy and ask for an opinion before attempting repairs.

    Worried about your TPS data?

    Clarion Programming Help specializes in supporting TopSpeed-based Clarion systems, including stabilizing programs that crash or show data errors, and preserving the business rules that sit on top of your data. If you have seen warning signs, want a more resilient setup, or are staring at an error message and not sure what to do next, Contact Us and describe what is happening. Please back up your data first and hold off on repair attempts until you have talked to someone experienced.