I'm confused when it comes to restoring backups. Installed Magento 2.4.2-p1, set periodical backups in webgui which can't be restored using webgui - after clicking "Rollback" nothing happens (tried in 2 different browsers and in incognito mode as well). Update: Each "Rollback" action button creates in console following errors:

Uncaught SyntaxError: Unexpected token '&'

and when followed would lead to JS script:

return backup.rollback('media', '1630195203');

What suppose to look more like(?): return backup.rollback('media', '1630195203');

So, I did try in cli:

bin/magento setup:rollback -m 1621213202_media.tgz

and it gave me following

The rollback file is invalid. Verify the file and try again.

Which means that gui and cli backups are not compatible? Next I created backups in cli:

bin/magento setup:backup --code --db --media

So far, so good but not for a long, when I was trying to restore them:

bin/magento setup:rollback -c 1621428237_filesystem_code.tgz -d 1621428237_db.sql -m 1621428237_filesystem_media.tgz

I received another error:

The rollback can't be executed because not all files are writable.

Files ownership is set as:

'Magento user':'web server group'

and permissions

find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} + find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +

What am I missing?

  • Updated my test instance to 2.4.3 and still is the same. Do I need to run commands as root? Sep 4, 2021 at 19:18


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.