Skip to content

How to “reset” or reinstall Magento 2 without data loss

While working in Magento 2 somehow I have managed to either corrupt some files or permissions.
I haven’t been messing with xml files but jumping from development to production and back to development. This caused some errors that I have tried to fix and somehow switching back to production seemed to work, but in admin I am getting this error on login:

1 exception(s):
Exception #0 (LogicException): Could not create an acl object: Invalid Document 
Element 'resource': The attribute 'title' is required but missing.
Line: 5

Element 'resource': The attribute 'title' is required but missing.
Line: 6

Element 'resource': The attribute 'title' is required but missing.
Line: 7

Element 'resource': The attribute 'title' is required but missing.
Line: 8

I am certain that I haven’t done anything with those elements in any xml file.

Some of the commands that I have been running in various orders most of the time are:

find var/view_preprocessed vendor pub/static app/etc generated/code var ( -type f -or -type d ) -exec chmod u+w {} +

/usr/bin/php71 bin/magento deploy:mode:set developer -s

/usr/bin/php71 bin/magento setup:di:compile

/usr/bin/php71 bin/magento setup:static-content:deploy hr_HR -f

/usr/bin/php71 bin/magento setup:static-content:deploy -f

/usr/bin/php71 bin/magento cache:flush

Now I am wondering is there a way to “redeploy” Magento 2 without causing data loss with idea to fix whatever is broken?

If not – can I make clean install, add components I need, move template and simply connect to “old” database?

Thank you all for help and time…