Migrating from embedded PostgreSQL to remote PostgreSQL database
- Back up the embedded PostgreSQL database on the BMC Server Automation application server.
- Install the PostgreSQL database server on a new computer.
- Create a superuser role named bcan having login privileges with password as bcan2226.
The following figure shows a sample user:
- Copy the database dump from the application server to the PostgreSQL database server.
- Log in to the database server as the bcan user.
- Create a database named bcan.
- Restore the database dump to the bcan database either using the pgAdmin III tool or follow these instructions:
- Navigate to the C:\Program Files (x86)\PostgreSQL\9.3\bin directory.
Run the following command:
pg_restore.exe --host localhost --port 5432 --username "bcan" --dbname "bcan" --section pre-data --section data --section post-data --schema public --verbose "C:\bcan.dump"
- When prompted for password, enter bcan2226.
- Stop the BCA-Networks Web Server service and the embedded database service.
- On the application server, modify the database.properties file, as follows:
- Navigate to the BCAN_DATA directory and open the database.properties file with a text editor.
Change the database server host name and port number, as follows:
From:bna.jdbcRealm.connectionURL=jdbc:postgresql://localhost:15432/bcan
To:
bna.jdbcRealm.connectionURL=jdbc:postgresql://databaseServerHostName:databaseServerPortNum/bcan
Replace
databaseServerHostName
anddatabaseServerPortNum
with actual values.
- Modify the catalina.properties file, as follows:
- Navigate to the BCAN_HOME\tomcat\conf directory and open the catalina.properties file with a text editor.
Change the database server host name and port number, as follows:
From:bna.jdbcRealm.connectionURL=jdbc:postgresql://localhost:15432/bcan
To:
bna.jdbcRealm.connectionURL=jdbc:postgresql://databaseServerHostName:databaseServerPortNum/bcan
Replace
databaseServerHostName
anddatabaseServerPortNum
with actual values.
- Modify the BcanInstalledConfiguration.xml file, as follows:
- Navigate to the BCAN_HOME directory and open the BcanInstalledConfiguration.xml file with a text editor.
Change the database type, database server host name, port number, installation type, and database URL as follows.
The contents of the existing file are:<property> <name>DATABASE_TYPE</name> <value>Postgresql (Embedded)</value> </property> <property> <name>DATABASE_HOSTNAME</name> <value>localhost</value> </property> <property> <name>DATABASE_PORT_NUMBER</name> <value>15432</value> </property> <property> <name>BCAN_SERVER_INSTALL_SET_SELECTION</name> <value>TYPICAL</value> </property> <property> <name>DATABASE_URL</name> <value>jdbc:postgresql://localhost:15432/bcan</value> </property>
Change the attributes as follows.
<property> <name>DATABASE_TYPE</name> <value>Postgresql</value> </property> <property> <name>DATABASE_HOSTNAME</name> <value>databaseServerHostName</value> </property> <property> <name>DATABASE_PORT_NUMBER</name> <value>databaseServerPortNum</value> </property> <property> <name>BCAN_SERVER_INSTALL_SET_SELECTION</name> <value>CUSTOM</value> </property> <property> <name>DATABASE_URL</name> <value>jdbc:postgresql://databaseServerHostName:databaseServerPortNum/bcan</value> </property>
Replace
databaseServerHostName
anddatabaseServerPortNum
with actual values.
- Start the BCA-Networks Web Server service.
Comments
Log in or register to comment.