Is it possible to change the default Magento backup folder (var/backup/
) to a different/external folder?
We want to keep the Magento folder as small as possible and save those backups in a different location.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityIs it possible to change the default Magento backup folder (var/backup/
) to a different/external folder?
We want to keep the Magento folder as small as possible and save those backups in a different location.
You need to rewrite the model Mage_Backup_Model_Fs_Collection
and replace this line
$this->_baseDir = Mage::getBaseDir('var') . DS . 'backups';
with the folder you want.
Also rewrite the helper Mage_Backup_Helper_Data
and change the return of the method getBackupsDir
. Make it return your folder.
As Marius puts it - you have to edit model to specify new path (this is sad, would be great to be on config), but this puts you at risk during next Magento update. After Magento update your backups will start going to the same default location.
I'd create a filesystem symlink from magento_install/var/backups/ to your external (non-website) location.
ln -s /whatever_your_external_localtion/ ./backups/