0

I usually take backup of the entire database before importing new configurations, but this time I didn't and now I need to double check something with old version of database. Is it possible to just revert the changes done by drush cim?

I am using Drupal 8.

Googling for this specific situation didn't give me any solution.

2
  • 1
    Configuration is saved in yml files inside the /config folder and not the database. If you use a version control system like GIT, you could see and also revert changes.
    – No Sssweat
    Sep 15 '21 at 6:42
  • You might still need a database backup, reverting config doesn't restore deleted content.
    – 4k4
    Sep 15 '21 at 12:21
0

No, you can't revert drush cim without a backup (or alternate config export) of some sort. If you don't have a backup, you're out of luck.

One safety measure to prevent this kind of problem is to write a script that backs up your database and then calls drush cim. Then, only run the script to do a config import, and you can ensure you have always made a backup first.

2
  • :( Thanks anyway! Sep 15 '21 at 5:37
  • 4
    Another safety measure is to use version control ;+)
    – No Sssweat
    Sep 15 '21 at 6:43

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.