8.3 Upgrading to Advanced Server 10 – Step-by-Step

Table of Contents Previous Next


8 Upgrading an Installation With pg_upgrade : 8.3 Upgrading to Advanced Server 10 – Step-by-Step

The basic steps to perform an upgrade into an empty cluster created with the initdb command are the same as the steps to upgrade into the cluster created by the Advanced Server 10 installer, but you can omit Step 2 (Empty the edb database), and substitute the location of the alternate cluster when specifying a target cluster for the upgrade.
If a problem occurs during the upgrade process, you can revert to the previous version. See Section 8.5, Reverting to the Old Cluster for detailed information about this process.
The target cluster must not contain any data; you can create an empty cluster using the initdb command, or you can empty a database that was created during the installation of Advanced Server 10. If you have installed Advanced Server in PostgreSQL mode, the installer creates a single database named postgres; if you have installed Advanced Server in Oracle mode, it creates a database named postgres and a database named edb.
The easiest way to empty the target database is to drop the database and then create a new database. Before invoking the DROP DATABASE command, you must disconnect any users and halt any services that are currently using the database.
On Windows, navigate through the 제어 Panel to the Services manager; highlight each service in the Services list, and select Stop.
After stopping any services that are currently connected to Advanced Server, you can use the EDB-PSQL command line client to drop and create a database. When the client opens, connect to the template1 database as the database superuser; if prompted, provide authentication information. Then, use the following command to drop your database:
DROP DATABASE database_name;
Where database_name is the name of the database.
CREATE DATABASE database_name;
During the upgrade process, pg_upgrade will connect to the old and new servers several times; to make the connection process easier, you can edit the pg_hba.conf file, setting the authentication mode to trust. To modify the pg_hba.conf file, navigate through the Start menu to the EDB Postgres menu; to the Advanced Server menu, and open the Expert Configuration menu; select the Edit pg_hba.conf menu option to open the pg_hba.conf file.
You should allow trust authentication for the previous Advanced Server installation, and Advanced Server 10 servers. Edit the pg_hba.conf file for both installations of Advanced Server as shown in Figure 7.1.
C:\Users\susan\Desktop\gedit.png
Figure 7.1 - Configuring Advanced Server to use trust authentication.
If the system is required to maintain md5 authentication mode during the upgrade process, you can specify user passwords for the database superuser in a password file (pgpass.conf on Windows, .pgpass on Linux). For more information about configuring a password file, see the PostgreSQL Core Documentation, available through:
Open the Services applet; highlight each Advanced Server or supporting component service displayed in the list, and select Stop.
During the upgrade process, pg_upgrade writes a file to the current working directory of the enterprisedb user; you must invoke pg_upgrade from a directory where the enterprisedb user has write privileges. After performing the above commands, navigate to a directory in which the enterprisedb user has sufficient privileges to write a file.
If the --serviceaccount service_account_user parameter was specified during the initial installation of Advanced Server, then service_account_user is the Advanced Server cluster owner and is the user to be given with the RUNAS command.
RUNAS /USER:service_account_user "CMD.EXE"
SET PATH=%PATH%;C:\Program Files\edb\as10\bin
During the upgrade process, pg_upgrade writes a file to the current working directory of the service account user; you must invoke pg_upgrade from a directory where the service account user has write privileges. After performing the above commands, navigate to a directory in which the service account user has sufficient privileges to write a file.
If the --serviceaccount parameter was omitted during the initial installation of Advanced Server, then the default owner of the Advanced Server service and the database cluster is NT AUTHORITY\NetworkService.
When NT AUTHORITY\NetworkService is the service account user, the RUNAS command may not be usable as it prompts for a password and the NT AUTHORITY\NetworkService account is not assigned a password. Thus, there is typically a failure with an error message such as, “Unable to acquire user password”.
Under this circumstance a Windows utility program named PsExec must be used to run CMD.EXE as the service account NT AUTHORITY\NetworkService.
The PsExec program must be obtained by downloading PsTools, which is available at the following site:
You can then use the following command to run CMD.EXE as NT AUTHORITY\NetworkService, and then set the path to the pg_upgrade executable.
psexec.exe -u "NT AUTHORITY\NetworkService" CMD.EXE
SET PATH=%PATH%;C:\Program Files\edb\as10\bin
During the upgrade process, pg_upgrade writes a file to the current working directory of the service account user; you must invoke pg_upgrade from a directory where the service account user has write privileges. After performing the above commands, navigate to a directory in which the service account user has sufficient privileges to write a file.
\i complete_path_to_script/script.sql
Please Note: If pg_upgrade fails to complete the upgrade process, the old cluster will be unchanged, except that $PGDATA/global/pg_control is renamed to pg_control.old and each tablespace is renamed to tablespace.old. To revert to the pre-invocation state:
2.
Rename $PGDATA/global/pg_control, removing the .old suffix.
If you modified the pg_hba.conf file to permit trust authentication, update the contents of the pg_hba.conf file to reflect your preferred authentication settings.

8 Upgrading an Installation With pg_upgrade : 8.3 Upgrading to Advanced Server 10 – Step-by-Step

Table of Contents Previous Next