All data for a TM1 server is typically held in a single folder we call the Data Directory. We recommend you backup this folder at the very least weekly. Although most servers have automatic backups owned by the IT Department it can be beneficial to have an archive backup (*.zip file) taken regularly which enables (subject to licenses) a TM1 Administrator to run a backup in parallel with their production server for the purpose of restoring data without engaging the IT Department.
What’s more, you can have multiple backups all sitting directly on the TM1 server, ready for you to restore and use as required. All without going anywhere near your IT administration team and getting a restore from tape.
Requirements to Backup TM1
- Download: Command Line version of 7-Zip found here: https://www.7-zip.org/download.html
- Access to the Server Running TM1
Theory for TM1 Backups
An optimal solution puts TM1 in charge of the archival process, enabling TM1 developers and administrators to backup the server from on a scheduled basis or from the TM1 frontend prior to development or data loads etc. As such its a logical fit that the backup is executed from a Turbo Integrator process. The 7-Zip Command Line interface provides this flexibility when combined with the TI Processes ExecuteCommand function.
Note: 7-Zip is a commercially available free file compression Application/Library.
Below is a sample of using this method, the path variables will need to be updated when it is initially set up but the basics should remain the same. This will create a backup archive with a date and time Stamp to differentiate it from other backups.
SaveDataAll();
sExec = 'D:/archiver/7za.exe';
sBackupDir = 'D:/TM1Servers/Finance\Backups';
sDataDir = 'D:/TM1Servers/Finance\Data';
sFileName = 'Data ' | TIMST(NOW(), 'Ymd h.i', 1) | '.zip';
sArgs = ' a -tzip ';
sCommand = sExec | sArgs | '"' | sBackupDir | sFileName | '" "' | sDataDir | '*"';
EXECUTECOMMAND(sCommand,0);
Note: This process does not wait for the command to finish before proceeding, this is simply so that TM1 doesn’t wait unnecessarily.
For simplicity sake the following lines need to be updated when this system is implemented on your site:
- sExec = ‘D:/archiver\\/7za.exe’; (The path to the 7-Zip Command Line Executable)
- sBackupDir = ‘D:/TM1/Servers/Finance/Backups’; (The Path to the Destination Directory)
- sDataDir = ‘D:/TM1Servers/Finance/Data’; (The Path to the TM1 Server’s Data Directory)
An Extract from the 7-Zip License File:
Notes: You can use 7-Zip on any computer, including a computer in a commercial organization. You don’t need to register or pay for 7-Zip.