Through a series of unfortunate events, I seem to be unable to restore from my latest full backup.
Full story to come, but at the moment the problem I’m having is during a backup restore it throws this error:
Migrating the database…
EXCEPTION: rake db:migrate
Failed to migrate database.
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled: (StandardError)
PG::DuplicateTable: ERROR: relation “gamification_leaderboard_scores” already exists
This seems to be a problem with my plugins, but I’d appreciate some help deciphering the logs for a solution to allow the restore to work.
Anyway, this is what happened.
Earlier today I performed a Discourse update to bring it up to 2026.5.0-latest b0873d3ecd, which introduced some breaking change causing my primary theme to stop working. I should have checked compatibility before updating.
In a panic, I thought I would be able to restore from my last backup to revert back to a Discourse version compatible with the theme. Before the restore, I did take a full backup thinking that if anything went wrong I want as many restore points as possible.
Well, something went wrong during this first restore and Discourse came back up missing the last 15 days of content. Looking into it further, I found a topic on Meta that suggested to rename the backup file from 2026-04-28-033449-v20260420014648.sql.gz to 2026-04-28-033449-v20260407093145.sql.gz I’m not sure why this worked, but it at least got me back up to yesterday’s backup.
I still need to restore from my last full backup taken this morning, which is the one giving the error shown at the top.