I need to change my backup directory to some other directory which is different from Magento installation root directory. How can i do this?


You need to override helper & it's function


public function getBackupsDir()
    return $this->_filesystem->getDirectoryWrite(DirectoryList::VAR_DIR)->getAbsolutePath('backups');

Instead of backups give ur folder name

How to override? http://blog.chapagain.com.np/magento-2-override-rewrite-block-model-controller-helper-using-plugin-preference/

  • there are lots of solutions to avoid core files changes... – MagenX Mar 21 '17 at 9:15
  • 1
    If u have better solution then please provide @MagenX – Jackson Mar 21 '17 at 9:28
  • as there is not much information from OP, see my coment about bind mounting – MagenX Mar 23 '17 at 8:41


public function getBackupDir()
return    $this->_filesystem->getDirectoryWrite(DirectoryList::VAR_DIR)->getAbsolutePath('backups');

Override Helper Data file

  • why he needs to override core files??? – MagenX Mar 21 '17 at 9:14

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.