In this task, we move the PostgreSQL datamart from its own instance to a separate box
in the dedicated database server mode.
-
Stop TeamForge on the
app box.
If this is a multi-box scenario, stop TeamForge on all other boxes as well.
- [RUNTIME_DIR]/scripts/collabnet stop
-
Do a dump of the PostgreSQL datamart. su - postgres -c 'pg_dump -C
-p <database-port > <reports-database-name >
<path-to-dump-file>
-
Create a new datamart instance using the
datamart-pgsql-setup.sh or follow the instructions below in
the database box.
-
initdb -D /var/lib/pgsql/9.0/reports
-
Set the REPORTS_DATABASE_PORT in
site-options.conf
Note: The port should use the same value as specified in
postgresql.conf as specified in the previous step.
The recommended value is 5632.
-
Re-create the [RUNTIME_DIR]in all the boxes.
- install.sh -r -d /opt/collabnet/teamforge
-
Restore the datamart into the new instance.
-
[RUNTIME_DIR]/scripts/db.py -a restore -t reporting -f
<dump-location>
-
Copy the postgresql-9.0 script from runtime scripts and replace
/etc/init.d/postgresql-9.0
-
Restore the datamart from the database box.
-
su - postgres -c 'psql -p <reports-database-port> <path-to-dump-file>
Note: Restart the Postgres service. If any warning messages are displayed, kill the service and start again.
-
Start the database in the database box.
- /etc/init.d/postgresql-9.0 start
-
Start the services in all boxes.
- [RUNTIME_DIR]/scripts/collabnet start all
-
Check if the existing data appears in charts.
-
Permanently remove the old datamart from the TeamForge instance.
- su - postgres -c 'dropdb <datamart-name> -p
<database-port>'