That sounds fantastic.
Something like this has been needed for a long time.
So far, I love it! I had to set the password in one place in the code, and adjust the backup directory in two places. Then I backed up and updated a localhost site in about 2 minutes with a few clicks.
One tiny suggestion. Have the backup directory (backup_path) default to:
'backup_path' => '#base_path/backup',
instead of the web root. This would allow those of us with many MODX installs in separate subdirectories to back up to a directory within a site. Otherwise, all the backups will be in the same directory with no way to tell which is which except the time.
@Pont- thanks, much appreciated! I'll be testing this out over the next month. Will come in handy.
Quote from: Pont at Aug 31, 2014, 02:19 PM
@Bob: I don't really think backups (and other files stored in the backup directory) should be accessible so I set the default above the web root (provided that the site is in the web root).
Good point. The trouble is that if you have multiple sites in subdirectories, a) the backup files end up in the web root, and b) the backup files for the different sites all end up in the same place.
One thing that might help would be to get the site_name System Setting, clean it up, and add it to the name of the backup file.
Another idea would be to store them under MODX_CORE_PATH, since people concerned about security will put that above the web root.
I'll look into adding specific information to the file name to make it more unique per site. site_name is a good candidate since it will be the same both on development and live server.
However, be aware that using the same file on several sites interferes with the functionality to backup/restore between different servers since the configuration is per site. The script isn't really intended to work with multiple sites. If you don't use that functionality there is no problem, but if you do, and want the configuration files to be updated automatically, you can't use the same file for different sites since the database credentials (the xmldata options) will differ.
The site name is now added to the backup file name to make it more unique. This is handy if you collect backup files from several installations in one directory. If the installed site's name corresponds to the name of the backup file you will only see the timestamp in the list of backup files. If the site name has been changed you will see every backup file in the backup directory with the site names included (if any).
Sounds good.
This looks great. I've uploaded to my root directory now how do I run it?
Everything I know I learned on the internet. Saved me thousands in College tuition,