Submit a ticketCall us

WebinarFREE IT Monitoring Webcast

Don’t miss out on our webcast, Essential IT Monitoring with SolarWinds ipMonitor, where we will show you how to keep an eye on your IT environment from one centralized, affordable, and lightweight monitoring tool: SolarWinds® ipMonitor®.

Register now.

Home > Success Center > Web Help Desk (WHD) > WHD - Knowledgebase Articles > Back up and restore the PostgreSQL database using the command line

Back up and restore the PostgreSQL database using the command line

Overview

This article describes how to back up and restore the embedded PostgreSQL database using the command line.

Environment

Web Help Desk 12.x installed on a server running Microsoft® Windows Server®, Apple® OS X, or Linux. 

Steps

The following table lists the paths to the Web Help Desk home directory.

Operating System Location
Microsoft Windows C:\Program Files\WebHelpDesk\
Linux or Virtual Appliance /usr/local/webhelpdesk/
Mac OS X /Library/WebHelpDesk/

Back up the PostgreSQL database

Windows Server

  1. Open a command prompt.
  2. In the window, execute:
    cd C:\Progra~1\WebHelpDesk
  3. Back up the database.
    Execute:
    pgsql9\bin\pg_dump -Fc -v -h 127.0.0.1 -p 20293 -U whd whd > whd_pgdump.backup
  4. Enter whd if prompted for a database password. 

Linux or Virtual Appliance

You can download the virtual appliance from the Customer Portal

  1. Download and start PuTTY or another SSHv2 client
  2. Connect to the Linux server.
    If you are connecting to a virtual appliance, connect as the user admin
  3. In Linux, switch to root user or any user with sudo privileges.
    In the Virtual Appliance,enter sudo su.
  4. Execute:
    cd /usr/local/webhelpdesk/
  5. Back up the database.
    Execute:
    pgsql9/bin/pg_dump -Fc -v -h 127.0.0.1 -p 20293 -U whd whd > whd_pgdump.backup
    Enter whd if prompted for a database password.

Apple OS X

  1. Open the Applications > Utilities > Terminal application.
  2. Execute:
    cd /Library/WebHelpDesk/
  3. Back up the database.
    Execute:
    pgsql9/bin/pg_dump -Fc -v -h 127.0.0.1 -p 20293 -U whd whd > whd_pgdump.backup
    Enter whd if prompted for a database password.

Restore the PostgreSQL database

Windows Server

  1. Open a command prompt.
  2. In the window, execute:
    cd C:\Progra~1\WebHelpDesk
  3. Restore the database.
    Execute:
    pgsql9\bin\pg_restore -Fc -v -h 127.0.0.1 -p 20293 -U whd -d whd path_to_whd_pgdump.backup
    Enter whd if prompted for a database password.

Linux or Virtual Appliance

  1. Connect to the Linux server.
    If you are connecting to a virtual appliance, connect as the user admin.
  2. Connect to the Linux server.
    If you are connecting to a virtual appliance, connect as the user admin
  3. In Linux, switch to root user or any user with sudo privileges.
    In the Virtual Appliance,enter sudo su.
  4. Execute:
    cd /usr/local/webhelpdesk/
  5. Restore the database.
    Execute:
    pgsql9/bin/pg_restore -Fc -v -h 127.0.0.1 -p 20293 -U postgres -d whd path_to_whd_pgdump.backup
    Enter whd if prompted for a database password.

Apple OS X

  1. Open the Applications > Utilities > Terminal application.
  2. Execute:
    cd /Library/WebHelpDesk/
  3. Restore the database.
    Execute:
    pgsql9/bin/pg_restore -Fc -v -h 127.0.0.1 -p 20293 -U postgres -d whd path_to_whd_pgdump.backup
    Enter whd if prompted for a database password.
Last modified

Tags

Classifications

Public