日本語マニュアル
EDB Postgres Enterprise Manager®
Upgrade and Migration Guide
Version 7.8
•
Upgrading a PEM Installation - Section 2 provides information about upgrading your PEM server from one major version to another (i.e. from 6.0 to 7.5).
•
Upgrading the Backing Database - Section 3 provides detailed information about upgrading the backing database, while maintaining the same version of the PEM Server.
•
Moving a PEM Server –Section 4 provides detailed information about moving the PEM server from one host to another host.
This document uses the term Postgres to mean either the PostgreSQL or the Advanced Server database.
In the following descriptions a term refers to any word or group of words that are language keywords, user-supplied values, literals, etc. A term’s exact meaning depends upon the context in which it is used.
•
Italic font introduces a new term, typically, in the sentence that defines it for the first time.
•
Fixed-width (mono-spaced) font is used for terms that must be given literally such as SQL commands, specific table and column names used in the examples, programming language keywords, etc. For example, SELECT * FROM emp;
•
Italic fixed-width font is used for terms for which the user must substitute values in actual usage. For example, DELETE FROM table_name;
•
Square brackets [ ] denote that one or none of the enclosed term(s) may be substituted. For example, [ a | b ], means choose one of “a” or “b” or neither of the two.
•
Braces {} denote that exactly one of the enclosed alternatives must be specified. For example, { a | b }, means exactly one of “a” or “b” must be specified.
•
Ellipses ... denote that the proceeding term may be repeated. For example, [ a | b ] ... means that you may have the sequence, “b a a b a”.
2.
Invoke the PEM server installer; this installer will upgrade both the PEM server and the PEM agent that resides on the PEM server node.
./pem_agent-x.x.x-linux.run
Where x.x.x specifies the version information for the installer.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\4ddc8f39\one.png
The PEM Agent Setup Wizard opens, welcoming you (see Figure 2.1).

C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\16126cee\patwo.png
Read and accept the License Agreement (shown in Figure 2.2) before clicking Next to continue.

C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\14106ae0\pathree.png
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\4966c6d5\pafour.png
When the Ready to Install dialog (shown in Figure 2.4) informs you that the installation is about to begin, click Next to continue.

C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\04185ab8\pafive.png

C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\949cec36\two.png
The PEM Agent Setup Wizard will inform you when the installation completes (see Figure 2.6). Click Finish to exit the wizard and close the window.
For detailed information about using an RPM package to install the PEM agent, please see the PEM Installation Guide or the Advanced Server Installation Guide, available at:
./pem_server-x.x.x-linux.run
Where x.x.x specifies the version information for the installer.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\05175ec4\one.png
The PEM Server Setup Wizard welcomes you, as shown in Figure 2.7. Click Next to continue to the License Agreement.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\8a3f83f5\pstwo.png
The PEM server setup wizard will prompt you to accept the License Agreement (shown in Figure 2.8). After reviewing the license agreement, check the radio button next to I accept the agreement, and click Next to continue to the Existing installation dialog.

C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\d5412951\psthree.png

C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\d7cb600a\one.png

C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\8a3e8356\psfive.png
The wizard then opens the Database Server Installation Details dialog, prompting you for connection credentials for database superuser of the PEM backing database (see Figure 2.11). Provide:
Click Next to continue.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\883e85ff\pssix.png
The Ready to Install dialog will inform you that the setup wizard is ready to perform the installation. Click Next to start the installation (see Figure 2.12).

C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\883c85d9\psseven.png
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\c548198b\pseight.png
Click OK to close the Info popup. The PEM server setup wizard informs you that the installation is complete (see Figure 2.15).
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\48ebcbaf\three.png
You must use an RPM to upgrade your PEM server on Linux host. For detailed information about using an RPM package to install PEM, please consult the PEM Installation Guide, available at:
The data directory path for the PEM backing database.
The directory for the database server installation. For example, /usr/edb/as10 for Advanced Server or /usr/pgsql-10 for PostgreSQL.
The installation type: Specify 1 if the configuration is for web services and backing database, 2 if you are configuring web services, or 3 if you are configuring the backing database. If you specify 3, please note that the database must reside on the local host.
For detailed information about using an RPM package to install or configure the PEM server, please see the PEM Installation Guide or the Advanced Server Installation Guide, available at:
If you are using a PostgreSQL installation on a Linux host, the script resides in the share/postgresql/contrib directory under the PostgreSQL installation.
On Windows, you can use the Services dialog to control the service. To open the Services dialog, navigate through the Control Panel to the System and Security menu. Select Administrative Tools, and then double-click the Services icon. When the Services dialog opens, highlight the service name in the list, and use the option provided on the dialog to Stop the service.
By default, the script resides in the share\contrib directory under your Advanced Server or PostgreSQL installation.
The new backing database must be running the same version of sslutils that the current backing database is running; you can download the SSL Utils package that is used in EnterpriseDB installers at:
You are not required to manually add the sslutils extension when using the Advanced Server as the new backing database. The process of configuring sslutils is platform-specific.
When the download completes, extract the sslutils folder, and move it into the Postgres installation directory for the Postgres version to which you are upgrading.
Open a command line, assume superuser privileges, and set the value of the PATH environment variable to allow make to locate the pg_config program:
export PATH=$PATH:/opt/Postgres/x.x/bin/
Postgres specifies either:
•
PostgreSQL if you are upgrading to a PostgreSQL server.
•
PostgresPlus if you are upgrading to an Advanced Server server.
x.x specifies the version of Postgres to which you are migrating.
Then, use yum to install sslutil dependencies:
Navigate into the sslutils folder, and build the sslutils package by entering:
sslutils must be compiled on the new backing database with the same compiler that was used to compile sslutils on the original backing database. If you are moving to a Postgres database that was installed using a PostgreSQL one-click installer (from EnterpriseDB) or an Advanced Server installer, use Visual Studio to build sslutils. If you are upgrading to:
After installing OpenSSL, download and unpack the SSL Util utility package available at:
Copy the unpacked sslutils utilities folder to the Postgres installation directory (i.e. C:\Program Files\PostgreSQL\9.x).
Open the Visual Studio command line, and navigate into the sslutils directory. Use the following commands to build sslutils:
SET USE_PGXS=1
SET GETTEXTPATH=
path_to_gettext
SET OPENSSLPATH=
path_to_openssl
SET PGPATH=
path_to_pg_installation_dir
SET ARCH=x86
msbuild sslutils.proj /p:Configuration=Release
path_to_gettext specifies the location of the GETTEXT library and header files.
path_to_openssl specifies the location of the openssl library and header files.
path_to_pg_installation_dir specifies the location of the Postgres installation.
When the build completes, the sslutils directory will contain the following files:
Copy the compiled sslutils files to the appropriate directory for your installation; for example:
/etc/init.d/service_name stop
systemctl/service_name stop
Where service_name specifies the name of the Postgres service.
On Windows, you can use the Services dialog to control the service. To open the Services dialog, navigate through the Control Panel to the System and Security menu. Select Administrative Tools, and then double-click the Services icon. When the Services dialog opens, highlight the service name in the list, and use the option provided on the dialog to Stop the service.
You can use the pg_upgrade utility to perform an in-place transfer of existing data between the old backing database and the new backing database. If your server is configured to enforce md5 authentication, you may need to add an entry to the .pgpass file that specifies the connection properties (and password) for the database superuser, or modify the pg_hba.conf file to allow trust connections before invoking pg_upgrade. For more information about creating an entry in the .pgpass file, please see the PostgreSQL core documentation, available at:
path_to_pg_upgrade/pg_upgrade
-d old_data_dir_path
-D new_data_dir_path
-b
old_bin_dir_path -B new_bin_dir_path
-p
old_port -P new_port
-u
user_name
path_to_pg_upgrade specifies the location of the pg_upgrade utility. By default, pg_upgrade is installed in the bin directory under your Postgres directory.
old_data_dir_path specifies the complete path to the data directory of the old backing database.
new_data_dir_path specifies the complete path to the data directory of the new backing database.
old_bin_dir_path specifies the complete path to the bin directory of the old backing database.
new_bin_dir_path specifies the complete path to the bin directory of the old backing database.
old_port specifies the port on which the old server is listening.
new_port specifies the port on which the new server is listening.
user_name specifies the name of the cluster owner.
Copy the following certificate files from the data directory of the old backing database to the data directory of the new backing database:
•
•
On Linux, the certificate files must be owned by postgres. You can use the following command at the command line to modify the ownership of the files:
chown postgres file_name
Where file_name specifies the name of the certificate file.
The server.crt file may only be modified by the owner of the file, but may be read by any user. You can use the following command to set the file permissions for the server.crt file:
chmod 600 file_name
Where file_name specifies the name of the file.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\c34d18de\server_key.png
Navigate to the Security tab (see Figure 3.3) and highlight a Group or user name to view the assigned permissions. Select Edit or Advanced to access dialogs that allow you to modify the permissions associated with the selected user.
The postgresql.conf file contains parameter settings that specify server behavior. You will need to modify the postgresql.conf file on the new server to match the configuration specified in the postgresql.conf file of the old server.
By default, the postgresql.conf file is located:
•
For Postgres version lower than 10 on Linux, in /opt/PostgreSQL/version.x/data
Where, version is the major version of Postgres on your system.
Use your choice of editor to update the postgresql.conf file of the new server. Modify the following parameters:
The port parameter to listen on the port monitored by your original backing database (typically, 5432).
The ssl parameter should be set to on.
Your installation may have other parameter settings that require modification to ensure that the new backing database behaves in a manner comparable to the old backing database. Review the postgresql.conf files carefully to ensure that the configuration of the new server matches the configuration of the old server.
The pg_hba.conf file contains parameter settings that specify how the server will enforce host-based authentication. When you install the PEM server, the installer modifies the pg_hba.conf file, adding entries to the top of the file:
By default, the pg_hba.conf file is located:
On Linux, in /opt/PostgreSQL/10.x/data
On Windows, in C:\Program Files\PostgreSQL\10.x\data
By default, the pg_hba.conf file is located:
Where, version is the major version of Postgres on your system.
Using your editor of choice, copy the entries from the pg_hba.conf file of the old server to the pg_hba.conf file for the new server.
/etc/init.d/service_name start
systemctl stop service_name
Where service_name is the name of the backing database server.
If you are using Windows, you can use the Services dialog to control the service. To open the Services dialog, navigate through the Control Panel to the System and Security menu. Select Administrative Tools, and then double-click the Services icon. When the Services dialog opens, highlight the service name in the list, and use the option provided on the dialog to Start the service.
The backing database of the target server may be a different version or type than the backing database of the source. If the new PEM server does not reside on the same type of backing database as the original server, you must ensure that the same version of the sslutils extension is installed on the new server host. The version of sslutils that is distributed with the PEM installers is freely available for download from the EnterpriseDB website at:
For information about installing the PEM server or the sslutils extension, please refer to the PEM Installation Guide, available at:
The migration process re-creates the pem, pemdata, and pemhistory schemas from the source PEM server on the target PEM server. In preparation for the move, use the psql client to delete these schemas from the pem database on the target host. You can open the psql client at the command line, or by selecting SQL Shell (psql) from the Postgres Enterprise Manager menu.
When the psql client opens, connect to the pem backing database as the database superuser. After connecting to the pem database on the target host, use the following commands to drop the schemas:
When dropping the schemas, you must include the CASCADE keyword, instructing the server to delete all dependent objects. When executing the command, the psql client displays a list of the dependent objects; the client confirms each the schema is removed by displaying DROP SCHEMA (as shown in Figure 4.1).
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\14a9230a\movetwo.png
SELECT id FROM pem.agent WHERE active = true;
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\5b56b8cd\msthree.png
Where x specifies an agent number (see Figure 4.3). Remember, agent1 is created on the target host by the PEM server installer.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\1622249f\movefour.png
Then, use the GRANT command to assign each agent that resides on the target PEM server pem_agent permissions:
Where x specifies an agent number (see Figure 4.4).
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\d8573dc4\movefive.png
You can use the pg_dump utility to generate a script that contains the commands required to recreate the pem database on the target host. By default, pg_dump is installed in the bin directory under your Postgres installation. To invoke pg_dump, open a command line, navigate to the bin directory, and enter:
pg_dump -U user_name db_name > file_name
user_name specifies the name of the database superuser for the PEM backing database.
file_name specifies the name of the script generated by pg_dump.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\da5d3bf2\mssix.png
The command shown in Figure 4.5 instructs pg_dump to generate a script that (when executed) will re-create the pem database. The script will be named backup.sql, and will be created in the tmp directory. pg_dump is connecting to the server using the credentials of the user, postgres.
Note that invoking the pg_dump utility will not interrupt current database users.
Move the script generated by the pg_dump utility to the target host of the PEM server.
Open a command line on the target host and navigate into the bin directory (under the Postgres backing database installation directory). Start psql, executing the script generated by the pg_dump utility:
psql -U user_name -d pem -f file_name
user_name specifies the name of the database superuser. The user specified must have connection privileges for the backing database.
file_name specifies the complete path to the backup script generated by pg_dump.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\d8d43c60\moveseven.png
The example shown in Figure 4.6 uses the psql client to invoke a script named backup.sql to recreate the pem database. The script is invoked using the privileges associated with the database superuser, postgres.
/etc/init.d/service_name stop
service_name specifies the name of the backing database server. For a PostgreSQL backing database, the service name is postgresql-x.x, and for an Advanced Server backing database, the service name is ppas-x.x, where x specifies the version number.
If you are using Windows, you can use the Services dialog to control the service. To open the Services dialog, navigate through the Control Panel to the System and Security menu. Select Administrative Tools, and then double-click the Services icon. When the Services dialog opens, highlight the service name in the list, and use the option provided on the dialog to Stop the service.
Copy the files to the data directory under the Postgres installation that provides the backing database for the target cluster. On Linux, by default, the files reside in:
On Linux, the certificate files must be owned by postgres. You can use the following command at the command line to modify the ownership of the files:
chown postgres file_name
Where file_name specifies the name of the certificate file.
The server.crt file may only be modified by the owner of the file, but may be read by any user. You can use the following command to set the file permissions for the server.crt file:
chmod 600 file_name
Where file_name specifies the name of the file.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\8e39848c\server_key.png
Navigate to the Security tab (see Figure 4.7) and highlight a Group or user name to view the assigned permissions. Select Edit or Advanced to access dialogs that allow you to modify the permissions associated with the selected user.
Copy the agent1.key and agent1.crt files from the source host to the target host. By default, on Linux, the files are installed in /root/.pem; copy the files to the same directory on the target host.
If necessary, navigate to /root/.pem, and use the following commands to modify the permissions and ownership of the agent1.key file:
Copy the agent1.key and agent1.crt files from the source host to the target host. On Windows, the files are located in:
C:\Users\user_name\AppData\Roaming\pem
Where user_name is the name of the user that invoked the PEM installer.
The ownership and permissions associated with the certificate files on the target machine should match the ownership and permissions of the certificate files on the source machine. If you invoked the PEM server and Postgres installer using the Run as Administrator option (selected from the context menu of the installer), the owner of the agent certificate files will be Administrators.
To review and modify file permissions on Windows, right-click on the file name, and select Properties. Navigate to the Security tab and highlight a Group or user name to view the assigned permissions. Select Edit or Advanced to access dialogs that allow you to modify the permissions associated with the selected user.
Modify the pg_hba.conf file on the target host to allow connections from each PEM agent. By default, the pg_hba.conf file is located in the data directory under your Postgres installation.
After modifying the pg_hba.conf file, you must restart the server for the changes to take effect.
/etc/init.d/service_name start
Where service_name is the name of the backing database server.
If you are using Windows, you can use the Services dialog to control the service. To open the Services dialog, navigate through the Control Panel to the System and Security menu. Select Administrative Tools, and then double-click the Services icon. When the Services dialog opens, highlight the service name in the list, and use the option provided on the dialog to Start the service.
Use your choice of editor to modify the agent.cfg file (shown in Figure 4.8), specifying the new IP address and port number of the PEM server in the pem_host and pem_port parameters.
By default, the agent.cfg file is located in:
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\85928a04\agentcfg.png
After modifying the agent.cfg file, you must restart the PEM agent service; you can use the pemagent service script on the Linux command line to restart the service:
Before modifying the Windows registry on the monitored node, confirm that the firewall on the host of the PEM agent will allow connections to the PEM server. After confirming that the PEM agent host can connect to the PEM server host, you can use the Windows Registry Editor to review and edit the PEM_HOST and PEM_PORT entries to ensure that they correctly identify the host and port used by the PEM server. To open the Registry Editor, enter regedit in the Windows Run dialog or in the Windows start menu search box.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\5171f269\Screen Shot 2016-11-03 at 9.50.24 AM.png
The PEM_HOST and PEM_PORT entries must specify the address and port number of the new PEM server on the target host. To modify a registry entry, right click on the entry Name, and select Modify from the context menu to open the Edit String dialog.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\cbd449a5\chregistry.png
Use the Edit String dialog to make any changes to the value of the entry (see Figure 4.10). When you're finished, click OK to save your changes, or Cancel to exit without saving.
After modifying the registry, you must restart the PEM agent's service; you can use the Services dialog (accessed through the Windows Control Panel) to restart the Postgres Enterprise Manager - pemAgent service (see Figure 4.11).
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\cbd54186\services.png
The default installation location for the PEM server when installed by the graphical installer is /opt/edb/pem. In the example that follows, substitute your server installation location for PEM_installation_path.
5.
When the repository configuration file installation completes, use your choice of editor to modify the dependencies and tools repository definitions, ensuring that the repository definitions are enabled and providing the correct repository credentials. For example, to use vi, enter:
6.
The yum makecache command downloads the metadata for the currently enabled repositories; when the command completes, check the available packages to confirm that the list includes the latest PEM server:
7.
Install the PEM server RPM; when the installation completes, use the yum info command to confirm the installation details:
8.
After installation, copy the agent.cfg file from the current location (the location required by the graphical installer) to the location required by the RPM package:
cp /PEM_installation_path/agent/etc/agent.cfg /usr/edb/pem/agent/etc/agent.cfg
Then, set the value of the ca_file parameter:
10.
Copy the pem.db file (and other required files) to the RPM installation location and change the file ownership:
cp -r /PEM_installation_path/server/share/pemhome/.pem/* /var/lib/pemhome/.pem/
11.
Change the home directory in the passwd file from the location identified by the graphical installer to the RPM location as follows:
/PEM_installation_path /server/uninstall-pemserver
16.
Enable the pemagent service and start the pemagent and httpd services.
The default installation location for the PEM server when installed by the graphical installer is /opt/edb/pem. In the example that follows, substitute your server installation location for PEM_installation_path.
5.
When the repository configuration file installation completes, use your choice of editor to modify the dependencies and tools repository definitions, ensuring that the repository definitions are enabled and providing the correct repository credentials:
6.
The yum makecache command downloads the metadata for the currently enabled repositories; when the command completes, check the available packages to confirm that the list includes the latest PEM agent:
Then, set the value of the ca_file parameter:
Then, copy the agent certificates; in the following commands, agent_id should specify the agent identifier (for example, agent2 or agent3):
mv /root/.pem/agent_id.key /root/.pem/agent_id.key.bkp
mv /root/.pem/agent_id.crt /root/.pem/agent_id.crt.bkp
mv /root/.pem/agent_id.key.bkp /root/.pem/agent_id.key
mv /root/.pem/agent_id.crt .bkp /root/.pem/agent_id.crt
13.
Enable the pemagent service, and start pemagent and httpd. On a RHEL or CentOS 7.x host, use the commands:
When restoring the pem backing database from backup, you may encounter an error during the restoration of the pem.alert table. This is caused by a missing table pre-requisite for the table - the pg_restore utility may restore the pem.alert pre-requisites after it attempts to restore pem.alert.
If you encounter this problem, restore the pem database before restoring the pem.alert table. Restoring the pem database will install the pre-requisites for pem.alert, and the restoration of the table should complete as expected.
Where x.x specifies the Postgres version.
./uninstall-component_name
Where component_name is the name of the component that you wish to remove.
If the PEM installation resides on a Windows host, you can use the Windows Add/Remove Programs application to remove PEM components. Select the Add/Remove Programs option from the Windows Control Panel; when the control panel opens, locate the name of the PEM component in the program list. Click the Remove button to remove the component.