cancel
Showing results for 
Search instead for 
Did you mean: 

Backup and Restore - can't restore

Backup and Restore - can't restore

I'm confused when it comes to restoring backups. Installed Magento 2.4.2-p1, updated to 2.4.3 (same behavior), 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).

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 (I use umask 002)

  • 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?

1 REPLY 1

Re: Backup and Restore - can't restore

The backup and restore has been deprecated by Magento. They recommend using 3rd party backup solutions. Here is the notice:

 

Deprecation Notice: Magento backup functionality is deprecated as of 2.1.16, 2.2.7, and 2.3.0. We recommend investigating additional backup technologies and binary backup tools (such as Percona XtraBackup).

 

https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-backup.html#enable-backu...