Restore the PostgreSQL database on a new server
You can migrate WHD 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. You can also Restore the database for macOS.
- Log in to the new WHD host server as an administrator.
- Copy the backup file from the old server to the new server.
- Stop WHD on the new server.
- On your WHD server, open the Apps page and click Services.
- 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. - Navigate to your
<WebHelpDesk>
directory.- macOS:
/Applications/WebHelpDesk
- Microsoft Windows:
\Program Files\WebHelpDesk
- Linux:
/usr/local/webhelpdesk
- macOS:
- Navigate to
pgsql9\bin
and double-click pgAdmin3. - In the pgAdmin3 window, click File > Add Server.
- Add the following information in the window:
- Name:
WHDDB
- Host:
localhost
- Port:
20293
- Maintenance DB:
postgres
- Username:
whd
- Password:
whd
- Name:
- In the Guru Hint window, click OK.
- Expand Databases.
- Right-click whd and select Delete/Drop from the menu.
- In the Guru Hint window, click Yes, and then click OK.
- Right-click Databases and select New Database.
- Set the following:
- Name:
whd
- Owner:
whd
- Name:
- Right-click
whd
and select Restore. - Navigate to the backup file that you copied from the old server, and then click Restore.
- Start WHD 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.