Score:0

Is there any way to revert the changes done by "drush cim"?

us flag

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.

No Sssweat avatar
ua flag
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.
4uk4 avatar
cn flag
You might still need a database backup, reverting config doesn't restore deleted content.
Score:0
cn flag

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.

Naser Nikzad avatar
us flag
:( Thanks anyway!
No Sssweat avatar
ua flag
Another safety measure is to use version control ;+)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.