Scheduling a WhereScape 3D repository backup

Modified on Sat, 13 May 2023 at 04:08 AM

The steps below outline how to schedule a WhereScape 3D repository backup using the WhereScape RED scheduler. Please note steps 1, 2 & 4 are not required if using WhereScape 3D version or above.

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)

$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!"
} catch {
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 3D\jre\bin\java"
$3DjarPath = "C:\Program Files\WhereScape\WhereScape 3D\WhereScape-3D-HEAD-bundle.jar"
$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 (or 3rd party scheduler) must be run under a specified domain user. Using a System Account will not work. If this is not acceptable to you please use the pg_dump utility.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article