Submitted By:
H Jeremy Bockholt (hjbockholt)
Category:
MRN site
Percent Complete:
100%
Priority:
4
Start Date:
2009-02-03
End Date:
2009-02-10
Task Summary:
docs for oracle to postgresql
Original Comment:
complete instructions for fully migrating from oracle to postgresql back end
Assigned To
hjbockholt
Dependent On Task
Hours:
4
Status:
Closed

Tasks That Depend on This Task

Task Id Task Summary
423 convert UCI site from oracle to postgreSQL

No Related Tracker Items Have Been Added

Responses

Comment Date By
Globally, these are the overall steps
HID migration for JIV2008/phaseIII steps.


1. your HID webserver java version is out of date. You must update the java to java/javac version "1.6.0_03" or better. We had to do this manually.
2. your GPOP database server postgresql version is out of date, BIRN-CC is able to help install version 8.3.5
3. once postgresql new version is installed you must update the configuration to allow connections from your HID webserver, by default all connection aside from local host are blocked.
4. You need to patch your Oracle HID database to the latest schema updates
5. Once patched, you need to export your Oracle HID database to postgresql format
6. install latest postgresql schema to postgreSQL server
7. patch and convert the postgresql data dump
8. patch the postgresql schema
9. import the postgresql data dump
10. build the latest HID web code from CVS and boostrap it to the postgresql server
2009-02-03 00:54 hjbockholt
After you have updated your oracle schema and exported the data to a dumpfile.sql file, do the following;
pre-requisites:
1. need fresh check out of postgreSQL schema using tagged release:
2. define FBIRN_HOME


1. Change user to postgres, i.e.

sudo su - postgres

2. Change directory to $FBIRN_HOME/HID/Schema/Postgres/db_objects
(n.b., to avoid permission issues, just copy the HID directory to /tmp and set $FBIRN_HOME to /tmp)

cd $FBIRN_HOME/HID/Schema/Postgres/db_objects

3. Create your new postgres database;

createdb hidprd
createlang -d hidprd plpgsql

4. Enter postgres sql;

psql -U postgres hidprd

5. Run the create_tables.sql script to create the tables;

\i create_tables.sql
\q

6. Exit out of user postgres;

exit

7. Change directory to Tables;

cd $FBIRN_HOME/HID/Schema/Postgres/db_objects/Tables

8. Change user to postgres, i.e.

sudo su - postgres

9. Enter postgres sql;

psql -U postgres hidprd

10. Need to fix the postgres database schema, run nc_schemaVersionAlter.sql

\i nc_schemaVersionAlter.sql
\q

11. Exit out of user postgres;

exit

12. Move your exported oracle dumpfile.sql file to
$FBIRN_HOME/HID/Schema/Postgres/db_objects/

mv PATH-TO-DUMPFILE.SQL/dumpfile.sql $FBIRN_HOME/HID/Schema/Postgres/db_objects/.

13. Clean up UTF errors;

iconv -c -f UTF-8 -t UTF-8 -o cleanfile.sql dumpfile.sql

14. Rename cleanfile.sql to dumpfile.sql

mv cleanfile.sql dumpfile.sql

15. Prepare for final data cleaning; (need to check this, for some reason the dbutils/bin/fix_dataobject.pl disappeared from CVS now)

cd $FBIRN_HOME/HID/Utilities/dbutils

cvs update -d

16. Fix your dumpfile.sql;

$FBIRN_HOME/HID/Utilities/dbutils/bin/fix_dataobject.pl $FBIRN_HOME/HID/Schema/Postgres/db_objects/dumpfile.sql

It writes the fixed version of the sql file to a file with the suffix .fixed, i.e. dumpfile.sql.fixed

17. Rename dumpfile.sql.fixed to dumpfile.sql

mv dumpfile.sql.fixed dumpfile.sql

18. Clean up UTF errors again;

iconv -c -f UTF-8 -t UTF-8 -o cleanfile.sql dumpfile.sql

18. Rename cleanfile.sql to dumpfile.sql

mv cleanfile.sql dumpfile.sql


19. script dataImport_200901231423.log

20. Change user to postgres, i.e.

sudo su - postgres
cd $FBIRN_HOME/HID/Schema/Postgres/db_objects

21. Enter postgres sql;

psql -U postgres hidprd


22. Import data to hidprd;

\i dumpfile.sql (*** look for errors ***) will take sometime depending on number of records in your database

23. Run final migration.sql script

\i migration.sql
\q

24. Exit out of user postgres;

exit

Congratulations, your data should have cleanly been imported into your new postgres database hidprd.

2009-02-03 00:53 hjbockholt

Task Change History

Field Old Value Date By
percent_complete90 2009-12-11 15:21 hjbockholt
status_id1 2009-12-11 15:17 hjbockholt
category_id100 2009-02-03 01:08 hjbockholt
priority3 2009-02-03 00:55 hjbockholt
percent_complete0 2009-02-03 00:55 hjbockholt