Restore the PostgreSQL database on a new server

You can migrate Web Help Desk to a new server running an identical or disparate operating system when required. If WHD is connected to an embedded PostgreSQL database, restore the embedded PostgreSQL database on the new host server.

You can restore the database by performing the following procedure or executing a command.

  1. Log in to the new Web Help Desk host server as an administrator.
  2. Copy the backup file from the old server to the new server.
  3. Stop Web Help Desk on the new server.
  4. On your Web Help Desk server, open the Apps page and click Services.
  5. In the Services window, ensure that one of the following services is running and displays in the list:
    • Web Help Desk PostgreSQL Embedded Database
    • PostgreSQL Embedded Database
    To start the service, right-click the service and select Start.
  6. Navigate to your Web Help Desk directory.
    • macOS: /Applications/WebHelpDesk
    • Microsoft Windows: \Program Files\WebHelpDesk
    • Linux: /usr/local/webhelpdesk
  7. Navigate to pgsql9\bin and double-click pgAdmin3.
  8. In the pgAdmin3 window, click File > Add Server.
  9. Add the following information in the window:
    • Name: WHDDB
    • Host: localhost
    • Port: 20293
    • Maintenance DB: postgres
    • Username: whd
    • Password: whd
  10. In the Guru Hint window, click OK.
  11. Expand Databases.
  12. Right-click whd and select Delete/Drop from the menu.
  13. In the Guru Hint window, click Yes, and then click OK.
  14. Right-click Databases and select New Database.
  15. Set the following:
    • Name: whd
    • Owner: whd
  16. Right-click whd and select Restore.
  17. Navigate to the backup file that you copied from the old server, and then click Restore.
  18. Start Web Help Desk on the new server.

Restore the database by executing a command

You can use the following command to restore the PostgreSQL database:

pg_restore -Fc -h 127.0.0.1 -p 20293 -U whd -d whd <path_to_whd_backup_file>

where:

  • -h is the target host.
  • -p is the port number.
  • -U is the user name being used.
  • -d is the target database name.