1. make package
I modified the existing "makepackage.php" script (...\Autodesk Infrastructure Web Server Extension 2013\www\mapadmin) in order to run it from command line. It needs some configuration parameters such as path to webconfig.ini and the Administrator's credentials (MapGuide Admin).
2. repository backup batch files
The backup scripts provided by MapGuide need a little modification - I added an "exit" at the end of each of the files I use and renamed them as well (kept the originals).
...
echo.
php -n RepositoryAdmin.php -c Restore -i "%cd%\..\BackupRepositories\Library\LastColdBackup" -o "%cd%\..\Repositories\Library"
echo.
exit
3. batch script
One batch script is needed to run all other scripts, for shutting down and restarting MapGuide service and for copying the backed up files to a different drive.
To run other batch files use:
...
start /wait call %batch_file_backup%
if ERRORLEVEL 1 goto error_start
...
This will run another batch file and wait until the batch file has finished. If the batch file does not finish succesfully you can catch an error code. A modification of the original batch files provided by Mapguide is required to get this to work - see above.
One click and files are backed up:
backup batch file in action |
Script files are available here.
Install:
1) Copy files to "..\Autodesk Infrastructure Map Server\RepositoryAdmin" folder.
2) check and modify settings in "makepackagescript.php"
3) check and modify settings in "AIMS_backup.bat"
4) run "AIMS_backup.bat"
This should work for AIMS 2013 and the corresponding MGOS version.