0

I just had a terrible learning experience. I spent several days building up a bunch of views, only to find that they vanished entirely from my site when I synchronized my configurations to handle another issue. They're gone. I have a dump of the db, but they're not on there either.

The funny thing is that not all of the views are gone. Some that I made several weeks ago are there, but the more recent ones are irrevocably lost.

And yes, I clicked "Save" on each view when I was creating it.

How can I be sure that this never happens again? What steps do I need to take save the views permanently in the db?

Version: Drupal 8.9.6

2
  • 1
    Without an extensive log of what you did and what your environment looks like, it's going to be near impossible to answer the question. A good preventative measure here if you're having to switch between configurations as you work on different things, is to capture all your configuration under a sync directory and git branch / drush cex / git commit as you switch around. All the views you add/update should be under views.view.*.yml files. – Shawn Conn Oct 2 '20 at 23:27
  • That's a great tip. My mistake was believing that everything would be saved in the database, too. I will now be doing exactly what you recommended. Thanks, Shawn! – sjhuskey Oct 3 '20 at 1:34
3

Shawn Conn's answer is what I needed. Going forward, I will now make it part of my routine to take snapshots of my configuration with drush cex and commit the changes. My mistake was believing that the views would be saved in the database.

1
  • 1
    Just a happy update: I was very relieved to find that my views were able to be rescued from a backup of the database. Do yourself a favor and backup your databases now. – sjhuskey Oct 4 '20 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.