Difference between revisions of "User:Tspc"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
m (minor)
m (reorganize)
Line 19: Line 19:
 
* My involvement with Adempiere is both as a hobby and some self-education, as I would like to gradually venture back into a programming/developer career.
 
* My involvement with Adempiere is both as a hobby and some self-education, as I would like to gradually venture back into a programming/developer career.
  
== Applying Migration Scripts ==
+
== Mercurial DVCS ==
 +
 
 +
===[[Converting_from_SVN_to_Mercurial|Converting from SVN to Mercurial]]===
 +
 
 +
===[[Mercurial_Test_Environment|Mercurial Test Environment]]===
 +
 
 +
 
 +
== Notes ==
 +
 
 +
=== Applying Migration Scripts ===
 
The appears to be a number of issues with the current methods of applying migration scripts.
 
The appears to be a number of issues with the current methods of applying migration scripts.
 
*Current methods
 
*Current methods
Line 48: Line 57:
  
  
== PL/Java ==
+
=== PL/Java ===
 
'''PL/Java Info'''
 
'''PL/Java Info'''
 
(Tested on Fedora 7 (Linux), and Postgresql 8.2.6, PL/Java 1.3.0)
 
(Tested on Fedora 7 (Linux), and Postgresql 8.2.6, PL/Java 1.3.0)
Line 93: Line 102:
  
  
== Adempiere-Libero Branch ==
+
=== Adempiere-Libero Branch ===
  
 
'''Tasks, Issues And Observations'''
 
'''Tasks, Issues And Observations'''
Line 103: Line 112:
  
  
== Mercurial DVCS ==
+
=== Upgrading Postgresql 8.1 to 8.3 on CentOS 5.x ===
 
+
===[[Converting_from_SVN_to_Mercurial|Converting from SVN to Mercurial]]===
+
 
+
===[[Mercurial_Test_Environment|Mercurial Test Environment]]===
+
 
+
== Upgrading Postgresql 8.1 to 8.3 on CentOS 5.x ==
+
  
 
*Relevant information on this topic
 
*Relevant information on this topic

Revision as of 16:03, 24 September 2011

Tony's User Boxes
Name This user real name is : Tony Snook
Sourceforge logo.png This user has a Sourceforge account.


Introduction

  • My name is Tony Snook and I am from Melbourne, Australia.
  • I can be contacted at tspc @ dodo.com.au
  • For the last 17 years I have been employed as the IT Manager for a company that manufactures scientific equipment. Before this I mainly worked as a C Programmer, writing software for embedded systems, Windows and DOS.
  • In the past 3 years I have been an active contributor to Adempiere, posting bug trackers, committing bug fixes/solutions, writing wiki documentation and participating in forums.
  • My involvement with Adempiere is both as a hobby and some self-education, as I would like to gradually venture back into a programming/developer career.

Mercurial DVCS

Converting from SVN to Mercurial

Mercurial Test Environment

Notes

Applying Migration Scripts

The appears to be a number of issues with the current methods of applying migration scripts.

  • Current methods
    • Manually applying each script using tools like
      • (for Oracle) sqlplus, toad, sqldeveloper, ....
      • (for PostgreSQL) psql, pgAdmin, ....
    • Using the ant build scripts which make use of sqlplus for Oracle and psql for PostgreSQL

Problems Include:

  • large number of migration scripts and their size
 makes it difficult to notice that an error has occured
  • error handling varies depending on the tool and database used
 SQLPLUS does not return an error code for any SQLPLUS (SP2-xxx) errors
  • rolling back after errors
 need to ensure that only completely successful scripts are applied and the partially completed script is rolled back.
  • reporting errors
 person applying the script must be notified that an error has occurred
  • keeping track of which scripts have been applied
 records need to be kept of which scripts have been applied to the current installation
  • how migration scripts are corrected
 -correcting a script once it has been committed to trunk can cause problems if someone has already applied the script
 -in some cases it is necessary to apply a script to undo the change and then apply the correct script


PL/Java

PL/Java Info (Tested on Fedora 7 (Linux), and Postgresql 8.2.6, PL/Java 1.3.0)

Recent security releases, of Postgresql, have altered the API for SetUserId to include an additional parameter indicating if we're in a security definer context.

  • If you are running any of the following postgresql releases, then you need to upgrade PL/Java
    • 8.0.x where x >= 15
    • 8.1.x where x >= 11
    • 8.2.x where x >= 6 (I needed it and I am running 8.2.5-11) Joseph.brower 11:52, 18 January 2008 (EST)
    • 8.3.x where x >= 0
  • Goto PL/Java CVS Information and check out the latest CVS of PL/Java.
    • Once you have the source, simply build the source with the 'make' comand.
  • If you are upgrading from pljava 1.3.0, then this is a minor upgrade.
  • I simply copied the binaries over the top of the existing installation.
 cp /build/pljava.jar /usr/var/lib/pljava/
 cp /build/deployer.jar /usr/var/lib/pljava/
 cp /build/objs/pljava.so /usr/var/lib/pljava/
  • su to postgres and restart postgresql
 su - postgres
 pg_ctl stop
 pg_ctl start
 exit
  • Your PL/Java should now be updated.

PL/Java Problems

  • If you are having problems with PL/Java, please check the following:
 Your postgresql.conf should contain the following lines:
 dynamic_library_path = '\$libdir:/usr/lib/pljava' 
 custom_variable_classes = 'pljava' 
 pljava.classpath = '/usr/lib/pljava/pljava.jar'
 
 Where /usr/lib/pljava is the path to your PL/Java installation (on some systems /opt/pljava ) and contains the following files: 
 deploy.jar
 install.sql
 pljava.jar
 pljava.so
 uninstall.sql

PL/Java Links


Adempiere-Libero Branch

Tasks, Issues And Observations

  • Libero Manufacturing installation documentation out of date and needs to be revised.
    • Wiki needs to be updated to reflect new structure. Libero is now an extension.
  • Libero Manufacturing Manual is out of date and needs to be revised.


Upgrading Postgresql 8.1 to 8.3 on CentOS 5.x


  • First, download the latest CentOS yum setup rpm:
 wget http://yum.pgsqlrpms.org/reporpms/8.3/pgdg-centos-8.3-6.noarch.rpm
  • Install the rpm package:
 chmod +x pgdg-centos-8.3-6.noarch.rpm
 rpm -Uvh pgdg-centos-8.3-6.noarch.rpm 
  • Edit /etc/yum.repos.d/CentOS-Base.repo:
    • add a line to exclude postgres related packages in both the base and updates sections.
    • You should end up with something like this:
   [base]
   name=CentOS-$releasever - Base
   mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
   #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
   gpgcheck=1
   gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
   exclude=postgresql*
   #released updates
   [updates]
   name=CentOS-$releasever - Updates
   mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
   #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
   gpgcheck=1
   gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
   exclude=postgresql*
  • Dump all databases using the clean option:
 pg_dumpall -U postgres -c > /var/backup/postgres/postgres_all.sql
 Note: Also make sure you have an ADempiere backup, just in case. (ExpDat.jar)
  • Update server to latest version:
 yum update 
  • Stop the server and move your old data directory:
 service postgresql stop
 mv /var/lib/pgsql/data /var/lib/pgsql/data_8.1 
  • Init a new postgres 8.3 database cluster:
 service postgresql initdb 
  • Update the configuration settings as necessary:
    • /var/lib/pgsql/postgresql.conf
    • /var/lib/pgsql/data/pg_hba.conf
  • Just to be on the safe side, make sure the permissions on the config files are correct (should be owned by user postgres):
 chown postgres:postgres /var/lib/pgsql/data/*.conf 
  • Start the database cluster:
 service postgresql start
  • Check that the connection to the server is working (and fix your config if it isn't):
 psql -U postgres 
  • Restore the dump of all databases:
 psql -U postgres < /var/backup/postgres/postgres_all.sql

Adempiere Related Interests

  • Manufacturing Module (Victor's contribution)
  • Data Transformation (Pentaho/Kettle)
  • Bazaar / Community
  • Mercurial DVCS

Interesting Links

 Database Independence
 Examining the Logic behind Database Independence
 10 golden rules for running an open source project