0

I pushed changes to StreamFields in my models (i.e., adding new block types) without creating Migrations, as specified in the docs. This resulted in a large loss of user data, and unfortunately there isn't a recent database backup.

If I were to go digging in a copy of the current Postgres database, would I be able to find the lost user data in the version history somehow? I'm also open to any other suggestions about how to recover the lost data, if possible.

tareq albeesh
  • 1,701
  • 2
  • 10
  • 13
jlt
  • 1
  • Would you be able to recover the lost data? Most likely not. Without a reliable backup your data is gone, even if you had immediately shut down the database. You can *restore* from the latest backup but that will not get anything later and may reintroduce legitimately deleted and undo updates. Worth it? Lessons: 1. Always assume your changes will fail in some way. 2. Always push changes from Development into a Test environment first. 3. Before pushing to Production **make a backup**. – Belayer Aug 20 '23 at 18:01

1 Answers1

0

From your question is not really clear what you did:

  1. Did you add/edit block to StreamField? In most cases should not remove data
  2. Did you migrate RichTextFields to StreamField? This indeed very likely replaced existing data

But in any case first check database and especially wagtailcore_revision table. It has content field which is json copy of all fields of the current page.