You must upgrade from N1 Provisioning Server, Blades Edition version 3.0 to version 3.1 before you can migrate your N1 Provisioning Server 3.0 database data from Oracle to PostgreSQL (Postgres).
Log in as root (su - root) on the control plane server.
Verify that the database administration group exists by typing grep dba /etc/group.
If the dba group exits, the response dba::100: is displayed. Go to the next step.
If the dba group does not exist, only the prompt is displayed. Type groupadd dba to create the database administration group.
Type useradd -g dba postgres to add the Postgres user account.
Change the database port.
Log onto the control center as administrator using a Control Center management PC.
The Control Center main screen is displayed.
Click Admin in the menu bar.
The Administration Screen is displayed.
Click I-Fabric in the Configuration Tools panel.
The I-Fabrics screen is displayed.
Replace the displayed port number with the Postgres port number 5432.
Click Commit Changes.
Click Logout to log out of the Control Center.
Type /opt/terraspring/sunone/bin/appserv stop to stop the control center application server.
Back up the control plane database.
Type the command /opt/terraspring/sbin/backupdb -o ${Oracle_Home} backup_file
where backup_file is the name you have chosen for the backup file.
Back up the Control Center database by typing /opt/terraspring/gwdb/bin/backupDB.sh.
The Control Center database is backed up to the file /var/opt/terraspring/gwdb/backup/tsprgwdb.backup.
Update the database properties file to point to the Postgres database and port.
The following single-line examples have been split across two lines for display purposes.
In the file /etc/opt/terraspring/tspr.properties, change the following DBConnection text string.
com.terraspring.core.sys.GridOS.DBConnection= com.terraspring.db.oracle.OracleCpdbConnection
to
com.terraspring.core.sys.GridOS.DBConnection= com.terraspring.db.postgres.PostgresCpdbConnection
Change to port number in the CpdbConnection text string from 1521 to 5432.
com.terraspring.db.CpdbConnection.port=1521
For example:
com.terraspring.db.CpdbConnection.port=5432
Save and close the file.
Install the Postgres database.
Create the Postgres database.
Type the command /opt/terraspring/lib/postgres/createdb -i -H localhost -o /opt/postgres -n tsprdb -f postgres_data postgres_log where postgres_data is the full path of the directory in which the database is created, and postgres_log is the full path name of the directory in which the database logs are saved.
Restore the control plane database data to Postgres.
Type the command /opt/terraspring/sbin/restoredb restore_file
where restore_file is the name of the control plane database backup file you created in Step 6.
Configure the database by typing /opt/terraspring/gwdb/bin/configure.sh.
You are prompted for configuration information. The following list shows the prompts and the required responses. Responses are case-sensitive and must be typed exactly as shown with no leading and no trailing spaces unless otherwise noted.
DB_TYPE: Postgres
DB Admin User: postgres
DB Admin Password: postgres
DB User: tcc
DB User Password: tcc
DB Host Name: localhost
DB Instance Name: tsprdb
DB Instance Listening Port: 5432
DB Backup Directory [/var/opt/terraspring/gwdb/backup]:
Press Enter.
DB Backup Filename [tsprgwdb.backup]:
Press Enter.
Initialize the Postgres database by typing /opt/terraspring/gwdb/bin/createDB.sh -y.
Restore the database Web configuration information by typing /opt/terraspring/gwdb/bin/restoreDB.sh.
The following messages appear:
WARNING: That will destroy the current Control Center database. Do you want to continue anyway(y/n)? [n]: |
Type y to continue.
Reconfigure the Control Center for Postgres.
Stop and reconfigure the Control Center application server by typing /opt/terraspring/sunone/bin/setup7.sh -silent.
The setup7.sh script stops and then reconfigures the Control Center (CC) application server using the files you have updated in the previous steps.
Type the following commands in sequence to stop and restart the monitoring manager:
/opt/terraspring/sbin/snmpd stop
/opt/terraspring/sbin/snmpd start
Type the following commands in sequence to stop and restart the segment manager.
/etc/rc3.d/S97sm stop
/etc/rc3.d/S97sm start
Type the following commands in sequence to stop and restart the monitoring manager:
/opt/terraspring/sbin/mmd stop
/opt/terraspring/sbin/mmd start
Restart the CC application server by typing /opt/terraspring/sunone/bin/appserv start