BIM Server Template Backup scripts for the PC

by GRAPHISOFT and Ed Brown · updated: 11.09.2010

/!\ Some programming experience required!

Outline of the backup

  1. Program control starts (bkup_main.bat). The program first makes sure that the directories where data will go and the install directory are correct. It will NOT run the backup if these are wrong. It will skip to “done:”

  2. Prepare an area on the local disk for the backup. (clean_tempfolder_log.bat)
  3. Make the master module backup. (BIM_bkup_all.bat)
  4. Backup the non-master module project data into a folder numbered for the version. (BIM_bkup_all.bat)
  5. Copy the backup to another computer which will create the backup media. (bkup_main.bat)
  6. End (bkup_main.bat)
    • {i} Additionally the routines log their progress.

How to implement the backup scripts in your environment

  1. Adjust in the scripts:
    1. The path to installDir, localBkUp, remoteBkUp and projectBkUp. Make sure to do this in all three scripts.
    2. Comment out lines for versions you do not need to backup.
  2. Test the scripts in a command prompt window that you open using “Run as Administrator.” This is done by right clicking on the command prompt icon in accessories.

    CmdPromptRunAsAdministrator.jpg

  3. Schedule scripts to run unattended

The PC Scripts Needed to Backup your BIM Server

bkup_main.bat

@echo off

set installDir=C:\Program Files\Graphisoft\BIM Server\Server Modules
set localBkUp=c:\BIMServer bkup
set remoteBkUp=\\BROWN-W8\public\BkUpTest
set projectBkUp=D:\BIM Server Databases\Projects

if not exist "%installDir%" echo Missing installation directory "%installDir%"

if not exist "%localBkup%" echo Missing local temporary folder "%localBkup%"
if not exist "%localBkUp%\AC14Project" echo Missing temporary holding subfolder "%localBkUp%\AC14Project"
if not exist "%localBkUp%\AC15Project" echo Missing temporary holding subfolder "%localBkUp%\AC15Project"
if not exist "%localBkUp%\AC16Master" echo Missing temporary holding subfolder "%localBkUp%\AC16Master"
if not exist "%localBkUp%\log" echo Missing temporary holding subfolder "%localBkUp%\log"

if not exist "%remoteBkUp%" echo Missing remote folder  "%remoteBkUp%"
if not exist "%remoteBkUp%\AC14Project" echo Missing target subfolder "%remoteBkUp%\AC14Project"
if not exist "%remoteBkUp%\AC15Project" echo Missing target subfolder "%remoteBkUp%\AC15Project"
if not exist "%remoteBkUp%\AC16Master" echo Missing target subfolder "%remoteBkUp%\AC16Master"
if not exist "%remoteBkUp%\log" echo Missing target subfolder "%remoteBkUp%\log"

if not exist "%installDir%" goto done

if not exist "%localBkup%" goto done
if not exist "%localBkUp%\AC14Project" goto done
if not exist "%localBkUp%\AC15Project" goto done
if not exist "%localBkUp%\AC16Master" goto done
if not exist "%localBkUp%\log" goto done

if not exist "%remoteBkUp%" goto done
if not exist "%remoteBkUp%\AC14Project" goto done
if not exist "%remoteBkUp%\AC15Project" goto done
if not exist "%remoteBkUp%\AC16Master" goto done
if not exist "%remoteBkUp%\log" goto done
 


rem -- clean local folder before dumping data to it
call clean_tempfolder_log.bat


rem --  Back up BIM Server Data
echo [ %date%  %time% ] Begin TeamworkBackUp  >"%localBkUp%\log\BIMbkup_script.log" 
call BIM_bkup_all.bat
echo [ %date%  %time% ] End TeamworkBackUp  >>"%localBkUp%\log\BIMbkup_script.log" 



rem --   Transfer dumped BIM data to backup server
echo [ %date%  %time% ] Begin file transfer to backup server : >>"%localBkUp%\log\BIMbkup_script.log" 
robocopy "%localBkUp%\AC14Project" "%remoteBkUp%\AC14Project" /E /ZB >nul 2>&1
robocopy "%localBkUp%\AC15Project" "%remoteBkUp%\AC15Project" /E /ZB >nul 2>&1
robocopy "%localBkUp%\AC16Master" "%remoteBkUp%\AC16Master" /E /ZB >nul 2>&1
echo [ %date%  %time% ] End file transfer to backup server  >>"%localBkUp%\log\BIMbkup_script.log" 


rem --  Transfer pln backups
echo [ %date%  %time% ] Begin pln transfer to backup server >>"%localBkUp%\log\BIMbkup_script.log" 
robocopy "%projectBkUp%" "%remoteBkUp%\Autobackup Flies" *.pln /S /ZB >nul 2>&1
echo [ %date%  %time% ] End pln transfer to backup server >>"%localBkUp%\log\BIMbkup_script.log"



rem --  Transfer log files to backup server
copy "%installDir%\1400\TeamworkServer\Logs\ProjectStoreBackupTool.log" "%remoteBkUp%\log\ProjectStoreBackupTool_AC14.log" >nul 2>&1
copy "%installDir%\1500\TeamworkServer\Logs\ProjectStoreBackupTool.log" "%remoteBkUp%\log\ProjectStoreBackupTool_AC15.log" >nul 2>&1
copy "%installDir%\1600\TeamworkServer\Logs\ServerBackupTool.log" "%remoteBkUp%\log" >nul 2>&1
copy "%localBkUp%\log\BIMbkup_script.log" "%remoteBkUp%\log"  >nul 2>&1 

:done

BIM_bkup_all.bat

@echo off

rem Drive and Directory where BIM Server modules are installed
set installDir=C:\Program Files\Graphisoft\BIM Server\Server Modules

rem For performance purposes it is best to dump to a local folder on the computer that hosts the Bim Server.
rem Once the dump is complete this folder is copied to a safe place on another machine -- possibly a backup server
set localBkUp=c:\BIMServer bkup

rem Non master modules only need to have the project's data dumped.  
rem Each module needs to be dumped into a separate directory, since restore tools work on per module basis.
rem Comment out modules that do not need to be backed up
call "%installDir%\1400\TeamworkServer\TeamworkServerProjectStoreBackupTool" "%localBkUp%\AC14Project" >nul 2>&1
call "%installDir%\1500\TeamworkServer\TeamworkServerProjectStoreBackupTool" "%localBkUp%\AC15Project" >nul 2>&1

rem Master dump will handle: users, roles, libraries properties and the projects in the master module
call "%installDir%\1600\TeamworkServer\TeamworkServerBackupTool" "%localBkUp%\AC16Master" >nul 2>&1

clean_tempfolder_log.bat

@echo off

rem Drive and Directory where BIM Server modules are installed
set installDir=C:\Program Files\Graphisoft\BIM Server\Server Modules

rem For performance purposes it is best to dump to a local folder on the computer that hosts the Bim Server.
rem Once the dump is complete this folder is copied to a safe place on another machine -- possibly a backup server
set localBkUp=c:\BIMServer bkup


del "%localBkUp%\AC14Project\" /F /S /Q  >nul 2>&1
del "%localBkUp%\AC15Project\" /F /S /Q  >nul 2>&1
del "%localBkUp%\AC16Master\" /F /S /Q  >nul 2>&1
del "%localBkUp%\log\" /F /S /Q  >nul 2>&1



rem -- ServerBackupTool.log maintains a running log of all backups.  
rem --    If you only need the log for the current backup
rem --    you should delete it before starting a new backup.
del "%installDir%\1400\TeamworkServer\Logs\ProjectStoreBackupTool.log" /F /Q >nul 2>&1
del "%installDir%\1500\TeamworkServer\Logs\ProjectStoreBackupTool.log" /F /Q >nul 2>&1
del "%installDir%\1600\TeamworkServer\Logs\ServerBackupTool.log" /F /Q >nul 2>&1


ping localhost -n 5 >nul

Further Comments on Scripts

  • To make sure that certain operations complete before others begin I was forced to break out the program into three separate batch files. In one case I used “ping localhost –n 5 >nul” to force a delay to make sure that the deletion of files really does happen before the backup starts. Secondly, the backup itself gets its own batch file just to make sure it completes before the folder it writes to is copied to the network backup server. If you have suggestions for improving this please let me know.

Related content

templatefiles--save

Template Files

See also: Template Files in ArchiCAD Help A template is a read-only project file with extension tpl. Why should I create my own template Templates are intended to cut down or eliminate the time to create a new project by reducing the repetitive task of…
transferprojects--transfera-b

How to Transfer Projects to Another Computer

ForWikiEditors : ToDo/ - draft This article discusses the process of transferring the ArchiCAD Projects, Libraries, Images, Linked Files from one computer to another. See also: Migration in ArchiCAD Step 1: Export Projects, Library Items and Drawing…
teamwork-transferbimserver--transfer-bim-server-files-method-1

Transfer BIM Server to Another Computer

This article discusses the process of transferring the BIM Server software, Project data, User data, Roles data and Libraries from one computer to another. Please note that there are special considerations for this process. Download article in…
teamwork-bimserverbackupcompleterestore--restore

Restore the master module from backup

Command to restore the master module TeamworkServerRestoreTool Source_folder_created_by_backup Command is found at: On Mac: /Applications/Graphisoft/BIM Server/Server Modules/[master module version]/TeamworkServer On PC: \Program Files\Graphisoft\BIM…