Tools
Restoring WHD database backup on WHD version 12.7.8 onwards with embedded PostgreSQL13 database for Windows Server
This article describes how to restore WHD database backup on WHD version 12.7.8 onwards with embedded PostgreSQL13 database.
First published date
Last published date
Overview
The following guide provides steps to restore the WHD database backup on WHD version 12.7.8 onwards with PostgreSQL13 embedded database. It can be used for reinstallation or migration.
After completing the re-installation or migration of WHD version 12.7.8 onwards, clients may face issues restoring their database, such as being asked for PostgreSQL embedded database credentials.
This information is for the WHD default PostgreSQL database only.
Before following the resolution, kindly ensure that:
- Database Backup of the old server has been copied on the new server
- Old Server WHD service has been stopped to avoid incoming emails to be processed as ticket on the old server.
- WHD has already been installed on the new server:
- Install WHD in a stand-alone deployment
- Create a temporary database during installation and complete the installation up until you are able to log in to the new WebHelpdesk.
- ***You can use the same information as your old database.
Product section
Resolution
Restore database using pgAdmin4 tool:
1. On the new server. go to services.msc. Stop the "Web Help Desk" service and keep the "Web Help Desk PostgreSQL 13.18 Embedded Database" running.
2. Go to C:\Program Files\WebHelpDesk\pgsql13\pgAdmin 4\bin but for 12.8.1 onwards, go to C:\Program Files\WebHelpDesk\pgsql13\pgAdmin 4\runtime
3. Run pgAdmin4.exe as Administrator.
If asked, set a master password for the pgAdmin4 tool. This will be used to secure and later unlock saved passwords and other credentials.
4. Click Add New Server. Set the following parameters in the new server registration window:
Under General:
Name: WHDDB
Under Connection:
Host: localhost
Port:20293
Maintenace Database: leave it as Postgres
Username: whd
Password: Your WHD username password
Role: whd
If the password of whd db admin has been forgotten, go to C:\Program Files\WebHelpDesk\pgsql13\data and look for pg_hba.conf.
Run notepad as an admin then open this file.
Scroll to the bottom and change all MD5 to TRUST
Sample:
host all all X.X.X.X/32 md5
will be changed to
host all all X.X.X.X/32 TRUST
Do this to all of the md5 entries at the bottom of the pg_hba.conf file then save.
Close everything and Restart the "Web Help Desk PostgreSQL 13.18 Embedded Database" service.
Start from Step 1 again, this time with a blank database password on Step 4.
5. On server WHDDB:
Go to Databases, right-click Databases > Create > Database.
Set the following parameters:
Under General:
Database: whd or create your own DB name
Owner: whd
Under Definition:
Tablespace: pg_default
Collation: English_United States 1252
Character type: English_United States 1252
Click Save.
7. Go to Login/Group Roles: Right-click Login/group roles > Create > Login/Group Role
Set the following parameters:
Under General:
Create a new login role name: Jane (for example)
Under Definition:
Set a password
Account Expires: No expiry
Under Privileges:
-Set everything to “Yes.”
Click Save.
Note: “Jane” should now appear under Login/Group Roles.
8. Go to the “whd” database: Right-click and select Properties.
Change owner to “Jane”
Click Save.
Note: Copy and paste your database backup file to C:\Program Files\WebHelpDesk
9. Right-click “whd” database > select Restore.
If a utility not found message will pop-up saying:
“C:\Program Files\WebHelpDesk\pgsql13\pgAdmin 4\runtime\pg_restore.exe not found.”
Just click OK.
10. Go to C:\Program Files\WebHelpDesk\pgsql13\bin and copy the address path.
11. Back to the pgAdmin4 tool, go to File > Preferences.
Scroll down to Paths > Binary paths.
Paste “C:\Program Files\WebHelpDesk\pgsql13\bin” on PostgreSQL Binary.
Click Save.
12. Right-click “whd” database again > Restore
On Filename, browse for the WHD database backup file, which was previously saved on “C:\Program Files\WebHelpDesk.”
Click Select > Restore.
13. Once the restore says it is completed. If you get an Error with Exit Code 1, you can ignore it.
14. Stop the WHD by running the whd_stop.bat as an admin from the WHD installation path (C:\Program Files\WebHelpDesk)
15. Go to C:\Program Files\WebHelpDesk and look for .whd.properties file.
16. Cut this file and move it somewhere.
17.Start the WHD service by running the whd_start.bat as an admin from the WHD installation path (C:\Program Files\WebHelpDesk)
Note: Make sure both Web Help Desk service and leave Web Help Desk Postgre13.3 database are running.
18. When the WHD browser launch, it will ask for the embedded PostgreSQL credentials. Set the following:
Database name: whd or your created own DB name
Username: Jane
Password: (Jane’s password)
Admin: admin
Password: admin (or your might asked for a complex password)
Note: On the pgAdmin tool, ensure that the owner is set to Jane on the “whd” database properties.
19. Click next. The Web Help Desk application should now load.
After login, click search under Tickets or Clients to ensure it’s all set.
Note: If you back up the database, it should now be saved on C:\Program Files\WebHelpDesk\pgsql13\Backups