Skip to main content

AdOr Auto Backup

Overview

The AdOrAutoBackup will create zip folders of database dumps based on the settings provided.

App Setup

To setup the app, you will have to extract the files from the compressed folder onto your disk. Once the files are extracted, you will have to setup the settings in the appsettings.json file.

appsettings.json

you will have to set the following settings:

DumpPath

DumpPath is the location of pg_dump.exe.

The default location of pg_dump.exe will be C:\Program Files\PostgreSQL\12\bin\pg_dump.exe.

If you have installed PostgreSQL in a different location, the path will be [Location]\PostgreSQL\12\bin\pg_dump.exe

SavePath

This is the path that the backups will be saved to. You can select any path to save to. The App will create the following directories in the path that was specified:

  • Auth - Authentication database backups
  • Site - Site database backups
  • Logs - Backup log files

The generated zip files will be named dd_MM_yyyy-HHhMM.zip (e.g. 01-01-2021-00h00.zip)

The backup files inside the zip files will be named [schemaname].backup.sql

The generated log files will be named dd_MM_yyyy-HHhMM.log (e.g. 01-01-2021-00h00.log)

Databases

The databases property is an array of the Databases object:

  • DBType
    • The type of database you are backing up.
    • The DBType property for authentication schemas should always be "Auth".
  • Database
    • The database name in PostgreSQL.
  • Host
    • The database host.
    • For on premises sites, the host will be "localhost".
    • For cloud sites, the host will be the IP address of the hosted server.
  • Port
    • The database port.
    • The default port for PostgreSQL is 5432.
  • Username
    • The database username.
  • Password
    • The password for the database user.
  • Schemas
    • A comma seperated array of schemas to include in the backups e.g. ["schema1", "schema2", etc.]

ZipDetails

This is the details for the zip files:

  • Password
    • This is the encrypted password for the generated Data zip files.
    • This will be provided by Ador.
  • AuthPassword
    • This is the encrypted password for the generated Authentication zip files.
    • This will be provided by Ador.
  • RetentionPeriod
    • The amount of days that the files will be kept before being deleted.
    • Default is 7 days.
    • Log files will use same retention period.

Verify settings

Once you have entered the settings, you should run AdOrAutoBackup.exe to create a backup of the specified databases/schemas to verify that the settings were set up correctly.

Creating a Scheduled Task (Example)

There are many ways to setup a scheduled task in Microsoft Windows, below is an example of one way to create a task. For more information on Microsoft Windows Task Scheduler, go to https://docs.microsoft.com/en-us/windows/win32/taskschd/using-the-task-scheduler

Steps to setup a task:

  • Open "Task Scheduler"
  • Create a new task
  • In "General"
    • Enter a name for the task e.g. AdOrAutoBackup
  • In "Triggers"
    • Create a new trigger on a schedule
    • Set the trigger to "Daily"
    • Set "Start" to [today] 00:00:00
    • Tick the box "Stop task if it runs longer than" and set it to 6 hours
  • In "Actions"
    • Create a new action to start a program
    • Set "Program/script" to the path for the AdOrAutoBackup.exe e.g. C:\AdOr5\AdOrAutoBackup\AdOrAutoBackup.exe
    • Set "Start in" to the location of AdOrAutoBackup.exe e.g. C:\AdOr5\AdOrAutoBackup
  • In "Settings"
    • Tick "Allow the task to run on demand"
    • Tick "Stop the task if it runs longer than" and set it to 6 hours
    • Tick "If the running task does not end when requested, force it to stop"