A Script for Running Automated Backups for Autodesk Vault

This is the basic script I setup for automated backups of the Vault. This will backup both the filestore and database to a single folder. This just needs to be edited to work with your Vault and the extension changed to .bat. Then, copy the file to your server where you can set up Windows Task Scheduler to run the bat file periodically.  Here’s the contents of the .bat file:

rmdir /Q /S “Drive:\Vault Backup\B”
rename “Drive:\Vault Backup\A” “B”
mkdir “Drive:\Vault Backup\A”
mkdir “Drive:\Vault_Temp”

“C:\Program Files\Autodesk\ADMS (Vault Edition) 20XX\ADMS Console\Connectivity.ADMSConsole.exe” -Obackup -B”Drive:\Vault_Temp” -VU”Administrator” -VP”PASSWORD” -VAL -DBSC -S -L”Drive:\Vault_Temp\Backup.txt”

“C:\Program Files\7-Zip\7z.exe” a -t7z “Drive:\Vault Backup\A\Vault_Backup.7z” “Drive:\Vault_Temp”

rmdir /Q /S “Drive:\Vault_Temp”
robocopy “Drive:\Vault Backup” “\\NetworkStorage\Backups\Vault” /e 

Let’s breakdown what I’m doing in the script.

First off, I have 2 drives on the system the Vault server is installed on.  C: is where my programs are installed.  D: is where my data is stored.  But, your drive letters may be different, so use C:\, D:\, E:\, etc. in place of Drive:\.

In my Vault backups folder, there are two subfolders called “A” and “B”.  “A” is the most recent backup while “B” is the previous backup.  To save space on my drive, I’m compressing the files using 7Zip and it’s command line features.  After I have a compressed backup, I then copy everything to my Network Attached Storage (NAS).

So, let’s take a look a the first line of the script:

rmdir /Q /S “Drive:\Vault Backup\B”

This line deletes the oldest backup, “B”, using the command rmdir to delete the entire folder.  The /Q makes it quiet, i.e. it doesn’t ask if it’s ok to delete.  The /S tells it to remove all files and subdirectories.

Next, I’m renaming the folder “A” to “B” by using the command rename.

rename “Drive:\Vault Backup\A” “B”

Next, I make a new “A” folder to save the backup  to.

mkdir “Drive:\Vault Backup\A”

I also make a temporary folder.  This is the folder that will be compressed and copied into “Drive:\Vault Backup\A”

mkdir “Drive:\Vault_Temp”

I then run the Vault Backup with everything being saved in “Drive:\Vault_Temp” (Since I’m running Vault Professional 2016 the executable path is “C:\Program Files\Autodesk\ADMS Professional 2016\ADMS Console\Connectivity.ADMSConsole.exe”)

“C:\Program Files\Autodesk\ADMS (Vault Edition) 20XX\ADMS Console\Connectivity.ADMSConsole.exe” -Obackup -B”Drive:\Vault_Temp” -VU”Administrator” -VP”PASSWORD” -VAL -DBSC -S -L”Drive:\Vault_Temp\Backup.txt”

That’s a long string of options there!  Let’s break it down:

  • “C:\Program Files\Autodesk\ADMS (Vault Edition) 20XX\ADMS Console\Connectivity.ADMSConsole.exe” this is the path to the executable that will be performing the backup. Quote marks were used to facilitate the running of the application in DOS mode.
  • -Obackup This is telling the executable to perform the backup.
  • -B”Drive:\Vault_Temp” This is the folder I used to store the backup in.  You may want to use a different folder. I used an underscore to represent spaces because this is running using DOS and does not support spaces.
  • -VU”Administrator” This is an administrator account that will be used to run the backup. This either needs to use the existing Administrator account, or it will be an account that needs to be created.
  • -VP”PASSWORD” The password for the administrator account performing the backup. If there is not a password then this would be blank.  Substitute the actual password for PASSWORD.
  • VAL Validates the backup. This records and errors to the log file.
  • -DBSC This switch tells the backup program NOT to include the standard Inventor Content Center libraries.  These can easily be re-installed after recovery and they are several gigabytes in size.  No real need to include them in most backups.  Note that CUSTOM Content Center libraries (anything edited by a user) WILL be backed up.
  • -S Runs the backup in silent mode without someone having to interact with the server.
  • -L”Drive:\Vault_Temp\Backup.txt” The path for the log to be created during the backup process.

Whew!  Barely made it through that behemoth of a command!  You still with me?  Good.  Let’s keep going.

I now run 7Zip in command line mode.  You can use other methods like PKZip and Windows’s built-in compression, but I already have 7Zip installed.  7Zip requires that you put the compressed file name first, and the folder or file you’re compressing second.

“C:\Program Files\7-Zip\7z.exe” a -t7z “Drive:\Vault Backup\A\Vault_Backup.7z” “D:\Vault_Temp”

Now that I’ve made a compressed file in the “Drive\Vault Backup Folder\A”, I no longer need “Drive:\Vault_Temp”.  So, I use RMDIR again to delete the folder and its contents.

rmdir /Q /S “Drive:\Vault_Temp”

Finally, I copy everything to my network storage using the command Robocopy.  Robocopy requires that you first tell it the folder you’re copying from, then the folder you’re copying to, then what options you want to use when copying.  I’ve told it to copy everything by using the /e option.

Robocopy “Drive:\Vault Backup” “\\NetworkStorage\Backups\Vault” /e 

And that’s it!  When the script is done, you should have the most recent Vault backup compressed in the “A” folder and the previous backup in the “B” folder.

If you don’t want to use compression on your Vault backups, here’s how the script looks without that option:

rmdir /Q /S “Drive:\Vault Backup\B”
rename “Drive:\Vault Backup\A” “B”
MKDIR “Drive:\Vault Backup\A”
“C:\Program Files\Autodesk\ADMS (Vault Edition) 20XX\ADMS Console\Connectivity.ADMSConsole.exe” -Obackup -B”Drive:\Vault Backup\A” -VU”Administrator” -VP”PASSWORD” -VAL -DBSC -S -L”Drive:\Vault Backup\A\Backup.txt”
Robocopy “Drive:\Vault Backup” “\\NetworkStorage\Backups\Vault” /e 

If your IT department uses another backup solution (like backing up to a cloud service or to another location), they should grab the contents of folders “A” and “B” after the script finishes.

You can now rest easy knowing that your precious Vault data is backed up, safe and secure.