Backup Suggestions - Make a large flashing sign to not rename your backups

AI-generated summary

A user, vel, encountered a backup restoration failure after renaming a backup file, prompting a discussion on improving backup warnings. vel suggested adding a prominent, glittery notice advising against renaming backups and proposed monthly reminders to download local backups — especially after losing online backups when their hosting provider disappeared. pfaffman countered that such issues are rare and not worth automated reminders, but noted that the correct filename can be reconstructed from the archive’s schema_migrations data — a solution confirmed by riking. codinghorror clarified that weekly local backups are enabled by default in Discourse, though pfaffman emphasized the issue arose from manually renaming an old backup. jomaxro mentioned ongoing efforts to embed metadata beyond filenames to allow safe renaming. vel confirmed successful restoration using the suggested method and reiterated the value of local backups for disaster recovery — citing personal loss of months of data after their host vanished. The thread highlights the importance of preserving backup filenames and maintaining local copies, despite the rarity of such incidents.

I received the message:

Failed to restore from backup because backup file was renamed

And then I found the reason in this thread:

A few suggestions from this:

  • Could you add a note to the user to not rename the backup if the name is important?

  • If there already is a note could you make it bigger and add more glitter?

  • Send out reminders once a month to run nay download a backup. Mine is old :frowning:

It’s fairly rare that someone has this problem. It’s usually pretty easy to resolve. Sending a monthly notice about something that affects virtually no one doesn’t seem very productive.

I think it’s possible to figure out what the name should be by information that’s in the archive. Maybe that’s what you really want.

I think that you might be able to restore the database by hand and then run the migration,for example.

Yes, this query will allow @vel to reconstruct the proper filename. Load the SQL file into a new, separate database and run this query:

select max(version) from schema_migrations

Alternately, find the schema_migrations data in the SQL file and manually pick the highest number.

Weekly (local) backups are on by default in Discourse. Isn’t that so @pfaffman ?

Yes. Weekly backups are the default.

This issue here was that he renamed an old backup and then couldn’t restore it the recommended way.

I also believe there’s ongoing discussion about including the metadata in a way other than the filename, allowing for file renames. But for now, renames should be avoided.

I was able to restore it! I followed the steps in the post at the top. I apologize that was not clear.

It was restored successfully.

The note / email would be to the Admins to save a backup locally to their computer incase the hosting company goes down or the hosting company server goes down (taking the online backups with it).

I know it’s rare but this actually really happened. The hosting company that hosted my discourse install vanished. I lost all of the online backups. I happened to save a backup locally from October 2020. So in total I lost a few months of posts. I was able to restore that backup once the forums were setup again.