Is it safe to truncate browser_pageview_events_backup after the September 2026 migrations?

AI-generated summary

scavin initiates a discussion regarding the safety of truncating backup tables created by September 2026 migrations on a self-hosted Discourse instance. Specifically, the tables browser_pageview_events_backup and browser_pageview_event_scores_backup were generated to archive duplicate legacy pageview events and those recorded after the Beacon cutover. The original post notes that the primary backup table contains nearly 2.9 million records occupying over 900 MB, with no new data added since September 21, 2026.

The user inquires whether it is safe to execute a TRUNCATE command on these tables to reclaim disk space while preserving the table schemas. They also ask if the archived records are necessary for any future reporting, recovery operations, or subsequent migrations, and whether there is an automated cleanup plan in place. The user confirms they reviewed the relevant migration scripts (20260910030404_archive_duplicated_legacy_browser_pageview_events.rb and 20260910030427_archive_piggyback_browser_pageviews_after_beacon_cutover.rb) and found no references to these backup tables in the application code outside of the migrations themselves.

In a follow-up after upgrading to the latest November 2026 version, scavin reports that both backup tables persist. Together, they now occupy approximately 962 MB of storage. Despite the migrations having completed and the forum operating normally for several months, the tables have not been automatically removed. The user reiterates their request for confirmation on whether it is now safe to manually truncate these tables to free up space, or if a future migration is expected to handle their cleanup.

Hi,

After updating Discourse, I noticed that the September 2026 migrations created two backup tables:

  • browser_pageview_events_backup
  • browser_pageview_event_scores_backup

On my self-hosted Discourse instance, browser_pageview_events_backup currently contains 2,869,175 records and occupies 902 MB.

The records range from July 11 to September 21, 2026, with no new records added since then.

I checked the relevant migrations:

  • 20260910030404_archive_duplicated_legacy_browser_pageview_events.rb
  • 20260910030427_archive_piggyback_browser_pageviews_after_beacon_cutover.rb

It appears these migrations archived duplicate legacy pageview events and events recorded after the Beacon cutover.

I also checked the application code and couldn’t find any references to these backup tables outside the migrations and database schema.

I have a few questions:

  1. Is it safe to TRUNCATE these backup tables now that the migrations have completed?
  2. Are these archived records still needed for any reporting, recovery, or future migrations?
  3. Is there a plan to automatically clean up these backup tables after a certain period?

I’d prefer to keep the table structures intact while reclaiming the disk space.

Thanks!

A quick update after upgrading my self-hosted Discourse instance to the latest version (November 2026).

Both migration backup tables are still present:

Table Size
browser_pageview_events_backup 902 MB
browser_pageview_event_scores_backup 60 MB

Together, they occupy approximately 962 MB.

Since the September 2026 migrations have been completed and the forum has been running normally, I’d like to revisit my original question:

Is it now safe to TRUNCATE both backup tables while keeping their schemas intact?

Or is there a planned migration that will automatically clean them up?

Thanks!