Pruning the SuiteCRM database and tracker tables

Pruning the SuiteCRM database and tracker tables keeps a self-hosted instance lean, but only after you confirm what each job removes, what retention your business needs, and how you will restore if something goes wrong.

On this page

How pruning the SuiteCRM database fits your housekeeping plan

Pruning is worth planning when your self-hosted SuiteCRM database and file store keep growing and list views or reports slow down. The Prune Database job, the Prune Tracker Tables job and the orphaned file removal job each clear a different kind of accumulated data, and they are the right starting point when the cause of slowness is data volume rather than PHP resources or missing indexes. Confirm exactly which records each job removes, whether it deletes or only marks data, and what it leaves behind, in the documentation for your SuiteCRM version before you schedule anything, because job behavior is not something to assume from the job name.

Pruning is a data retention decision as well as a performance task. Removing old tracker entries, soft-deleted records or unlinked files changes what your users, auditors and legal team can later look up, so the list of what to keep should be agreed with the business owners and your compliance lead before a job runs. Soft-deleted records still occupy space and still take part in queries until they are purged, which is why their cost shows up as slow pages long after a user thinks the data is gone.

Treat pruning as part of the same change window as your backups and staging tests. Take a verified backup of the database and instance files first, using the steps in your backup and restore procedure, and run the jobs on a copy of production so you can measure row counts, list view timings and report times before and after. Record the results and the restore point together, so that if a job removes data someone needs, you know exactly what state to return to.

Ask your implementation partner or internal team to write the pruning plan into your housekeeping calendar: which jobs run, how often, who approves the retention rules, who checks the scheduler afterward, and how a restore would be tested. Pruning that runs unattended without a documented owner tends to surprise people later, so the plan should name that owner and the review date.

Which pruning job fits which kind of database growth

This table compares the Prune Database job, the Prune Tracker Tables job, orphaned file removal and leaving data in place. Read each row as a question: what is growing, what the job touches, and what you must settle before running it. The main takeaway is that none of these jobs decides retention for you, so the policy comes first and the job follows.

OptionGrowth it addressesWhat it removes or leavesDecide firstVerify afterward
Prune DatabaseSoft-deleted records that still occupy rows and related data in core modulesPermanently removes records already marked deleted; live records and their relationships are left in placeRetention period for deleted records, whether any deleted data is under legal hold, and whether audit needs require a copy firstConfirm record counts in affected modules, check list views and reports still load, and confirm a backup was taken beforehand
Prune Tracker TablesGrowth in user activity history stored in tracker tables from normal browsing and editingClears old tracking entries; business records, field values and documents are left unchangedWhether anyone relies on activity history for investigations or audits, and how far back that history must reachConfirm the tracker tables shrank as expected and that record history views still show the period you chose to keep
Orphaned file removalUploaded files and attachments no longer linked to any record in the databaseDeletes files on disk or object storage with no database link; linked files and their records are left in placeWhether files were removed from records for a reason that still needs them, and whether storage is shared with other systemsCheck that known documents still open from their records and that the storage footprint changed as expected
Leave data in placeGrowth that is expected, governed or still needed for compliance or dispute handlingNothing is removed; storage and table size continue to growDocumented business reason to keep the data and a plan for capacity and performance tuning insteadTrack table growth against your capacity plan and confirm list views and reports stay within agreed response times
Archive or export before pruningRecords that must be kept for a defined period but no longer need to sit in the live CRMCopies the data out to a controlled store before any deletion runs; the live CRM still loses the records once prunedTarget location, access controls, format and how long the archive must be retainedTest that archived records can be retrieved and read, and that the live instance no longer shows pruned records
Restore from backup for a specific recordA deleted record is needed again after pruning has runRecovers from a backup taken before the job; the restore brings back data, not a new retention decisionWhich backup holds the required state and who approves the restoreConfirm the record, its relationships and attachments are back, and that the restore did not overwrite newer changes

The decision path from soft delete to a pruned database

The path starts when a user soft deletes a record in the SuiteCRM UI, which leaves the row in the database. Retention and legal requirements are checked next, and the business owner and compliance lead must approve before anything is removed. An approved request gets a verified backup and a restore test on staging, then a DBA signs off on the job to run: Prune Database, Prune Tracker Tables, orphaned file removal, or none. Staging is checked through list views and reports before the same change runs in production and is recorded.

Sign-off points where the business owner, compliance lead and DBA must approve before pruning runs.

What soft-deleted records cost in size and performance

SuiteCRM generally marks a deleted record as deleted rather than removing its row, so the database keeps growing even as users remove records from their screens. Those flagged rows stay in the main module tables, and the rows that hang off them stay too: relationship link rows, tracker entries that record who viewed or changed a record, and audit history where auditing is enabled. Over months, a busy sales or service instance can accumulate a large share of rows that no user will ever see again but that the database still has to store, index, scan and back up. The effect is cumulative, which is why it often surfaces only after a year or two of normal use, when a list view that once loaded quickly starts to lag.

Bloated tables slow work in four places. List views and searches read and filter large tables, and deleted rows can still be scanned unless queries and indexes exclude them efficiently. Reports join several tables, so extra relationship and tracker rows widen every join. Backups and restores take longer because they copy everything, including rows nobody needs. Tracker growth also matters on its own, because it is written on almost every page view. How much any of this costs depends on your data volume, your indexes, the database server's memory and storage, and how your team filters lists. Two instances with identical row counts can behave very differently, so do not assume pruning will help until you measure.

Record a baseline before you change anything: row counts for the main module, relationship and tracker tables, database size on disk, and timings for the list views and reports your users complain about. Repeat the same measurements after pruning and after any index work. Pruning does not replace index tuning through vardefs or PHP resource changes, which are covered on the slow list views and reports page. Treat the database-side and application-side fixes as separate steps so you can tell which one made a difference, and confirm the exact jobs and retention behavior for your SuiteCRM version in the SuiteCRM home page documentation and your own staging test before running them in production.

How to run pruning jobs on a SuiteCRM instance safely

This sequence takes a SuiteCRM instance from a retention decision to a recorded production pruning run, with a verified backup and a staging rehearsal in between so that deleted data can be recovered if a job removes more than intended.

  1. Confirm version and database engine

    Record the exact SuiteCRM version in production and the database engine and version it runs on, then check both against the SuiteCRM 8 compatibility matrix. The supported PHP, Apache, MariaDB and MySQL versions are listed there, and the matrix is the reference for your release. Confirm the names of the Prune Database, Prune Tracker Tables and orphaned file removal jobs, their menu locations and any command-line options in the documentation for your version. The step is complete when the version, engine and job names are written in the change record and the engine is shown as supported.

  2. Agree retention and legal hold rules

    Work with the business owners, compliance lead and legal contact to define which records, tracker entries and attachments may be removed, how long soft-deleted records are kept, and which records are under legal hold and must be excluded. Pruning cannot tell a hold from an ordinary record, so these rules must be written down before any job runs. The step is complete when a signed retention decision lists each object type, its retention period and its hold exclusions, and the approver has been named.

  3. Take and verify a full backup

    Back up the database and the instance files, including uploaded documents or object storage, using your documented backup procedure. Keep the backup in a location the pruning job cannot touch. Verify it by checking that the dump completes without errors, the file count and size look plausible, and the backup can be read by a separate restore tool. The step is complete when the backup set has a recorded checksum and a restore has been confirmed to start on a separate host.

  4. Restore to staging and run the jobs

    Restore the verified backup to a staging instance built on the same SuiteCRM version and database engine as production. Run the pruning jobs there using the settings agreed in the retention decision, and capture the record counts for each affected table before and after. Compare the counts against the expected removals. The step is complete when the staging counts match the retention decision and any unexpected removals are explained or the settings are corrected and the rehearsal is repeated.

  5. Review list views, reports and audit history

    On staging, open the list views, saved reports and dashboards that depend on the pruned data, and check that they still return the expected rows and load in reasonable time. Confirm that audit history for records still in scope remains readable and that held records are intact. Note that some features may depend on tracker or audit data, so confirm with your version's documentation which views rely on it. The step is complete when a reviewer signs off a checklist of the views and reports, with any defects logged and resolved.

  6. Schedule the production run in a maintenance window

    Agree a maintenance window with the business and the support team, and announce that users may see interruptions. Confirm a current backup exists immediately before the run, that the rollback steps are written and that the person who can restore the backup is available. Plan to run the jobs with the same settings used on staging. The step is complete when the change ticket is approved, the window is booked and the rollback owner has confirmed availability.

  7. Run the production jobs and verify

    Run the Prune Database, Prune Tracker Tables and orphaned file removal jobs in the agreed order, following the steps you confirmed for your version. Compare the production record counts and file counts with the staging results, check the application logs for errors, and reopen the key list views and reports. The step is complete when counts match the rehearsal within the expected difference, no new errors appear in the logs, and the held records are confirmed intact.

  8. Record the change and retain evidence

    Write up the change with the version, database engine, retention decision, backup reference, staging counts, production counts, log review and sign-offs. Store the record with the retention decision and set a date to repeat the review, since pruning is normally repeated under the same retention rules. The step is complete when the change record is filed where auditors and the compliance team can find it, and the next review owner is named.

Security and operational risks when pruning SuiteCRM data

Pruning removes data that people, auditors and connected systems may still need, and some of that removal cannot be undone. The cards below cover the risks to assess before enabling the Prune Database, Prune Tracker Tables and orphaned file jobs, and the control and check that goes with each one.

Irreversible deletion needs a tested restore

Pruned rows are gone from the live instance, and a pruning job does not keep a recoverable copy for you. Before any run, take a full database and file backup and prove it restores on a staging instance that matches production. Confirm with your own backup owner which restore point you would use if a prune removes records that a team still works on, and how long a restore takes in your environment.

Pre-change backup guidance

Loss of tracker history

Tracker tables record user activity, and investigations or compliance reviews sometimes ask who viewed or changed a record and when. Pruning those tables removes that history from SuiteCRM itself. Decide with your security and compliance leads which activity records must survive, and whether they are exported to your log platform or archive before the job runs.

Who may run destructive jobs

Scheduler jobs and admin actions that delete data should be limited to a small set of named administrators. Confirm which roles can open the scheduler and trigger these jobs, and whether those actions appear in your audit trail. Keep the change to job configuration under the same review process as other production changes, so a destructive run is traceable to a person and an approval.

Orphaned files still hold data

Removing a record does not always remove its attachments, documents or exported files from storage. Those files can still contain personal or confidential content after the record is gone. Before enabling orphaned file removal, list where uploads are stored, including any S3 or Azure object storage, and check that the cleanup job reaches every location your team uses.

Retention rules differ by data class

A single pruning window rarely fits every record. Contracts, complaints, consent records and marketing data can carry different legal or contractual retention periods depending on the data class and the jurisdiction where customers sit. Ask legal and records owners to document a retention schedule for each data class before you set any prune criteria, and confirm that the schedule overrides the default settings.

Effects on integrations and workflows

Scheduled workflows, reports, calendar sync and external integrations may read records that a prune removes, and they can fail silently or produce incomplete output. Before running a prune, list every workflow and integration that queries the affected modules, and test them against a staging copy after a prune run. Confirm which owner is notified when a dependent job starts returning empty results.

Limits to confirm in your own environment before pruning

The supplied release information does not settle how the Prune Database, Prune Tracker Tables and orphaned file removal jobs behave in each SuiteCRM 8 minor release. Minor 8.x releases arrive roughly every eight weeks, and patch releases carry only security and bug fixes, but that does not tell you whether the pruning logic, its defaults or its table selection changed between your current version and the one you plan to run. Read the release notes for your exact target version, and confirm with the vendor documentation how each job selects rows before you schedule anything. Do not assume that behavior seen on one 8.x release carries over to the next.

Two questions are also open. The first is whether tracker and audit data can be partially retained, for example keeping recent rows while removing older ones, or keeping audit records for a fixed period that your policy requires. Confirm with SuiteCRM what each job will and will not delete, and test a partial-retention approach on a staging copy before relying on it. The second is how pruning interacts with your database engine and version. Check the SuiteCRM 8 compatibility matrix for the supported PHP, Apache, MariaDB and MySQL versions, and confirm that your engine is on that list. For release lifecycle context, including which lines receive security fixes, read the SuiteCRM LTS page.

Treat staging results, vendor documentation and your own retention policy as the authority, not general guidance about CRM housekeeping. Run each job on a restored copy of production, record row counts and runtime, confirm that deleted data is gone and that retained data still renders, and check that backups taken before the run restore cleanly. Write down the retention rule your compliance owner has approved before the first production run, because a pruning job that deletes audit history cannot be undone from within SuiteCRM.

Questions teams ask before pruning a SuiteCRM database

What does pruning a SuiteCRM database cost?

Cost depends on the work around the pruning jobs, not the jobs themselves, which run from the SuiteCRM admin area. The main components are an assessment of table sizes and soft-deleted volumes, a staging rehearsal, a written retention rule approved by the business, backups taken before the run, and a post-run check of list views and reports. Costs rise when the database has custom tables, heavy integrations that write to CRM records, or many business units that need separate retention rules. Costs fall when retention rules are already documented. No supplied figure exists for this work, so ask any vendor or partner for a fixed-scope quote that lists each of these items separately, states what is one-time, and states whether any ongoing review or retainer is included.

How long does a SuiteCRM pruning project take?

Duration is set by how much data needs a retention decision and how many teams must sign off, more than by the technical run itself. The timeline usually covers measuring table growth, agreeing which records may be purged, rehearsing on a copy of production, scheduling a window, and verifying results. Environments with large tracker tables, custom modules, or several legal or regional retention rules take longer. No supplied duration applies, so ask for a written schedule with named milestones and the dependencies each one waits on, including the business owner's approval date.

What does pruning need from our internal team?

Pruning needs three roles working together. A DBA confirms database size, indexes, backup coverage and the effect of deletes on storage. A SuiteCRM administrator identifies which modules, tracker data and attachments the jobs will touch, and checks the scheduler and file permissions before the run. A business owner signs off on what may be removed, because a purge cannot be reversed in a practical sense. Ask any partner to show which of these roles they expect from your staff and how many hours of each you should plan for.

Can our internal team prune the SuiteCRM database alone?

Yes, a team with database and SuiteCRM administration skills can run the built-in jobs, provided it has a tested backup, a staging copy and written retention rules. The risk sits in the decisions: deleting the wrong records, missing attachments stored outside the database, or breaking integrations that expect older rows. If your team lacks one of the three roles above, or has not restored a backup recently, a partner can cover that gap. Ask a partner to name the skills it will provide and which parts you keep.

Can we recover records after pruning?

Assume not. The Prune Database job removes soft-deleted records from the database, so recovery depends on a backup taken before the run. Restoring from that backup can bring back the data, but it also rolls back any changes made after it was taken. Before pruning, confirm the backup covers the database and the instance files, test a restore on staging, and agree with the business how long pre-prune backups are kept. Ask any partner how it verifies that a restore works.

How do pruning, backups and upgrades relate?

Take a full backup of the database and instance files immediately before any prune, and keep it until the business accepts the results. Pruning should not be combined with an upgrade in the same window, because a failed prune and a failed upgrade become hard to separate. Run the prune on a staging copy first, then after the SuiteCRM upgrade is verified on production. Check the SuiteCRM upgrade notes for the version you are moving to, since they can change how tables are handled. Ask your partner to schedule these steps in a documented order.

When should we bring in an outside partner for pruning?

Bring in a partner when pruning touches regulated records, when the database is large enough that a failed run would hurt operations, or when your team lacks a DBA or SuiteCRM administrator for the work. A partner is also useful when retention rules are disputed across departments. DeployOpen plans, implements, hardens, backs up, upgrades and documents self-hosted open-source platforms in the client's own infrastructure, and most engagements are fixed-scope with the scope and timeline agreed in writing before work starts. Ask any partner for its written scope, its rollback plan, and what it will hand over at the end.

How DeployOpen scopes and delivers SuiteCRM pruning work

DeployOpen treats pruning the SuiteCRM database and tracker tables as a planned change to a system you run, not a one-off cleanup. We start from your retention rules and current database size, then agree in writing what gets pruned, how it is tested and how it is handed over.

How we scope

  • Review your retention requirements for records, tracker data and attachments before any job is enabled
  • Inventory the Prune Database, Prune Tracker Tables and orphaned file removal jobs and their current settings
  • Agree in writing which modules, tables and date ranges are in scope, with a quote that follows from that scope
  • Confirm backup and staging availability, since pruning deletes data that cannot be recovered from SuiteCRM alone

How we build

  • Run the pruning jobs first against a staging copy of your production database and file store
  • Measure table sizes and list view response before and after each change so results are compared, not assumed
  • Check soft-deleted records, linked relationships and attachments so pruning does not break related screens or reports
  • Document the job schedule, parameters and rollback steps, and agree a change window with your operations team

How we hand over

  • Deliver a runbook covering each job, its schedule, expected effects and the checks to run afterward
  • Provide a record of the before and after measurements and the retention rules applied
  • Walk your administrators through the scheduler checks and logs they need to confirm pruning ran as planned
  • Confirm the restore procedure and backup points that apply before any future pruning run

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts
  • Ongoing support, upgrades and continuous testing are available as a retainer for systems that need regular pruning reviews
  • Re-check job behavior after SuiteCRM minor releases, since each release has its own notes to review
  • Confirm support terms, response expectations and retainer scope in the written agreement

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.