Step 1: Create a Postgres ODBC DSN called '3DRepo' pointing to your 3D repository. Save the credentials in the ODBC DSN.

Step 2: Create a Host Script in RED / PowerShell 64 type and add the code below:

(This script is used to remove all locks from the repository. A back-up is only possible when all the objects are unlocked.)

$conn = new-object System.Data.Odbc.OdbcConnection
$conn.connectionstring = "DSN=3DRepo;"
$sqlCommand="DELETE FROM wsmeta.wb_obj_lock"
$cmd = New-object System.Data.Odbc.OdbcCommand($sqlCommand,$conn)
try {
Write-Host 1
Write-Host "Unlock executed successfully!"
Write-Host $_.Exception.Message }

Step 3: Create another Host Script RED / PowerShell 64 type and add the code below:

(This script sets paths and variables and then uses 3D CLI to execute the back-up. You will need to edit the variables based on your environment)

$repo = "Demo"
$3DPath = "C:\Program Files\WhereScape\WhereScape 3D\"
$JavaPath = "C:\Program Files\WhereScape\WhereScape
$3DjarPath = "C:\Program Files\WhereScape\WhereScape 3D\WhereScape-
$DateFormat = Get-Date -Format ""
$BKP_Dir = "C:\Temp\"
$BKP_Name = "$($DateFormat)_$($repo)"
Set-Location -Path "$3DPath";
Invoke-Expression '& $JavaPath -Xmx512m -XX:MaxMetaspaceSize=512m -
splash: -jar $3DjarPath backuprepo -repo $repo -o
"$($BKP_Dir)$($BKP_Name)" -f'

Step 4: Execute the first script and check if the objects are unlocked.

Step 5: Execute the second script and check if the back-up file is created in the specified location.

Step 6: Create a new Job in RED containing both scripts and schedule the Job.

The WhereScape RED scheduler must be run under a specified domain user. Using a System Account will not work.