# Setting Up Postgres 14 Database

The Call History Postgres Database stores all the Call History records for MiVoice Business Console operators.

Note: The Postgres 14 Server configuration is valid only for MiVoice Business Console Release 9.3 and above.

## Prerequisites

- A Windows PC that meets the basic Postgres Server requirements. For more information, refer to MiVoice Business Console Installation and Configuration Guide.

- The server PC's port 5432 must be available to the network and all other MiVoice Business Consoles.

Note:

- The Postgres server can be installed on one of the MiVoice Business Consoles if required.

- It is recommended to keep the Server PC on at all times to facilitate the proper functioning of Call History and Transfer Assistant features of all MiVoice Business Consoles.

## To set up the Call History Postgres Database

Note: The following steps describe the installation procedure for a 64-bit installer. Refer to the PostgreSQL website for details on 32-bit installer.

1. Download the Postgres Server Installation package from the website:

   https://www.postgresql.org/download/windows/

2. Execute the downloaded installation package.

   The Setup wizard appears.

3. In Setup wizard, under Select Components, clear the Stack Builder check box, and click Next.

   Note: By default, all the check boxes are selected.

4. Specify the database location and click Next.

   Note: It is recommended to create a sub-folder 14 to differentiate between future Postgres Server versions.

5. Enter a password for the Postgres user and click Next.

   Note: This password is used by Postgres SQL server database administrator when migrating to a newer version of Postgres.

6. Do not modify the default Port number (5432) and click Next.

7. Do not modify the default Locale ([Default locale]) and click Next.

   The Summary window is displayed.

8. Click Next.

   The Ready to Install window is displayed.

9. Click Next.

10. After the installation is complete, click Finish.

11. Open the pgAdmin 4 application to connect to the database server.

    Go to C:\Program Files\PostgreSQL\14\pgAdmin 4\bin to launch pgadmin4.exe

    The application displays the current server.

12. Enter a master password and click OK.

13. Expand Servers to view currently installed Postgres 14 server.

14. Enter a password and click OK.

15. If new server does not appear, right-click Servers, point to Create, and click Server.

    The Create -Server dialog is displayed.

16. In the Name field, enter the name of the server. For example, Local Host.

17. Click the Connections tab, and enter the following details:

    - Host name/address- enter localhost or the DNS name of your remote computer.

    - Port- enter 5432 as the port number.

    - Maintenance database- enter a name for the maintenance database.

    - Username- enter a user name for the server.

    - Password- enter a password for the Postgres user.

18. Click Save.

19. Create a role with the name:

    1. Expand Local Host, right-click Login/Group Roles, point to Create, and click Login/Group Role.

       The Create - Login/Group Role dialog is displayed.

    2. In the Name field, enter ipconsoleattendant.
       Note: A new login role must be added before creating the database. The IP console attendant account is used by all consoles for logging in. The same login role can be simultaneously used by all MiVoice Business consoles.
    3. In the Comments field, enter comments for the role.

    4. Click the Definition tab.

    5. Enter password for the role.

       Note: This password is configured on each MiVoice Business Console on Call History option form. If it is an upgrade to a newer Postgres Server, it is recommended to reuse the existing IP console attendant password.

    6. Click Privileges tab and set Yes for all the privileges except Can initiate streaming replication and backups?

    7. Click Save.

20. Create a database with the name IP_CONSOLE_5550:

    1. Expand Local Host, right-click Databases, point to Create, and click Database.

       The Create - Database dialog is displayed.

    2. In the Name field, enter IP_CONSOLE_5550.

    3. In the Comments field, enter comments for new database.

       Note: Although 5550 IP Consoles are no longer supported, the name IP_CONSOLE_5550 is chosen so that the customers migrating from 5550 IP consoles to MiVoice Business consoles can retain their previous database entries.

    4. Click Save.

       The database IP_CONSOLE_5550 is created.

       Note: The call_history table is created by the first console that connects to the database.

## Configure Postgres Network Parameters

The network parameters must be configured on pgAdmin application to provide access for MiVoice Business Consoles on the network.

To set Postgres network parameters:

1. Open the pg_hba.conf file in the Notepad application.

   Note: Typically, the file is located in the C:\Program Files\PostgreSQL\14\data directory.

2. Scroll to the bottom of the file and add the network parameters as shown in the following example.

3. On the File menu, click Save, and close the file.

## Configuring MiVoice Business Console

Call History feature must be enabled on MiVoice Business Consoles in the network. For detailed procedure, see Configure Call History.

Backup

To back up the call history database:

1. Open the pgAdmin 4 application.

2. Using the left pane, navigate to Server > <Your Server Name (for example, Local Host) > Databases > IP_CONSOLE_5550 > Schemas > public > Tables > call_history.

3. On the Tools menu, click Backup.

   The Backup dialog is displayed.

4. In the Filename field, enter a file name with the directory location where you want to save the backup file.

5. Click Backup.

Purge

You must periodically purge the Call History database to improve performance.

To purge call history database:

1. Open the pgAdmin 4 application.

2. Using the left pane, navigate to Server > <Your Server Name (for example, Local Host) > Databases > IP_CONSOLE_5550 > Schemas > public > Tables > call_history.

3. On the Tools menu, click Query Tool.

   The Query Editor is displayed.

4. To retain only the last one year data, in the Query Editor, type delete from call_history where call_time < date(now()) – 365 and click to purge the call history database.

   A dialog is displayed with the result.

Parent topic: Set Up the Call History Database
↑