Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
13 views
ago in CompleteFTP by (52.2k points)

The events.db file in the CompleteFTP Logs folder has grown very large and I'm seeing "Failed to write events data" errors in the logs. How can I reduce its size or prevent it from growing too large?

1 Answer

0 votes
ago by (52.2k points)
edited ago by
 
Best answer

The events.db file is a SQLite database that stores event data used by the Reports tab in the CompleteFTP Manager. It records logins, logouts, file uploads, downloads, and other activity. Over time this file can grow very large, especially on busy servers, which can eventually cause "Failed to write events data" errors.

We do plan to add auto-purging of the database as a feature, but until then the solutions below can be used.

Option 1: Delete and recreate (quickest)

If you don't need historical report data:

  1. Stop the CompleteFTP service
  2. Navigate to C:\ProgramData\Enterprise Distributed Technologies\Complete FTP\Logs\
  3. Delete events.db (and events.db-wal and events.db-shm if present)
  4. Start the CompleteFTP service

A new, empty database will be created automatically.

Option 2: Selective purge using PowerShell

If you'd like to keep recent data while removing older records, we provide an interactive PowerShell script that walks you through the process. It shows the estimated file size for different retention periods so you can make an informed choice before deleting anything.

Download the script from our GitHub: Purge-CompleteFTPEvents.ps1

Prerequisites

The script requires sqlite3.exe, which is a free download:

  1. Go to https://sqlite.org/download.html
  2. Under Precompiled Binaries for Windows, download sqlite-tools-win-x64
  3. Extract sqlite3.exe and place it in the same folder as the script

Running the script

Open an Administrator PowerShell prompt and run:

.\Purge-CompleteFTPEvents.ps1

The script will:

  • Locate the events.db file automatically
  • Show the total number of records and the date range
  • Offer to back up the database before making changes
  • Show estimated file sizes for different retention periods
  • Let you try different values before committing
  • Stop and restart the CompleteFTP service as needed

Example output

--- Analyzing database ---
  Total event records: 2,022,649
  Date range: 2025-09-19 12:16:34 to 2026-03-23 12:10:04
  Database size: 841.7 MB

--- Choosing retention period ---
  Estimated database size for different retention periods:

    Keep         Records kept   Est. size   Reduction
    ----------   ------------   ---------   ---------
    30 days           341,113   ~ 142 MB   -83%
    60 days           658,956   ~ 274 MB   -67%
    90 days           997,876   ~ 415 MB   -51%
    120 days        1,339,432   ~ 557 MB   -34%
    180 days        2,019,408   ~ 840 MB   -0%
    All             2,022,649   841.7 MB

Automated/scheduled use

For unattended use (e.g. via Task Scheduler), run with -DaysToKeep and -NonInteractive:

powershell.exe -ExecutionPolicy Bypass -File "C:\path\to\Purge-CompleteFTPEvents.ps1" -DaysToKeep 90 -NonInteractive

Option 3: Disable event recording

If you don't use the Reports feature and want to prevent events.db from growing at all:

  1. Open the CompleteFTP Manager
  2. Select the top-level server node
  3. Uncheck Event recording enabled
  4. Apply the changes

With event recording disabled, you can safely delete the events.db file while the service is stopped. It will not be recreated unless event recording is re-enabled.

Categories

...