[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: First upgrade attempt from 1.2.21 -> 1.3.0RC4 == Fail




I've been trying a different path using the 1.2-1.3-manual.sql script using a script (below).

It chugs along until:

ALTER TABLE lsmb12.employee ADD entity_id int;
***(press return to proceed or enter x and return to cancel)************
ALTER TABLE
***(Single step mode: verify command)************************
INSERT INTO entity(control_code, entity_class, country_id)
select 'E-' || employeenumber, 3,
        (select id from country where lower(short_name) = 'us')
FROM lsmb12.employee;
***(press return to proceed or enter x and return to cancel)*********
psql:sql/upgrade/1.2-1.3-manual.sql:376: ERROR: duplicate key value violates unique constraint "entity_pkey"
***(Single step mode: verify command)*********************************
UPDATE lsmb12.employee set entity_id =
       (select id from entity where 'E-'||employeenumber = control_code);
***(press return to proceed or enter x and return to cancel)**************
psql:sql/upgrade/1.2-1.3-manual.sql:379: ERROR: current transaction is aborted, commands ignored until end of transaction block
***(Single step mode: verify command)**************************
INSERT INTO person (first_name, last_name, entity_id)
select name, name, entity_id FROM lsmb12.employee;
***(press return to proceed or enter x and return to cancel)******
psql:sql/upgrade/1.2-1.3-manual.sql:382: ERROR: current transaction is aborted, commands ignored until end of transaction block
***(Single step mode: verify command)**************************

and so on.

The pre upgrade found a few things which are fixed with:

update customer set customernumber='X0183c' where id= 17686;
update  ar set  invnumber='1214a' where id=17334;
update  ar set  invnumber='1214b' where id=17336;
update  ar set  invnumber='1209a' where id=17238;
update  ar set  invnumber='1206a' where id=17168;
update chart set link = 'AR_tax:AP_tax:IC_taxpart:IC_taxservice' where id = 15796;
update chart set link = 'AR_tax:AP_tax:IC_taxpart:IC_taxservice' where id = 15269;
update chart set link = 'AR_tax:AP_tax:IC_taxpart:IC_taxservice' where id = 15532;
update employee set  employeenumber = 1 where id=10090;
update employee set  employeenumber = 2 where id=10091;



--------------------------- script starts here ---------------------
#
#
#

set -o xtrace

echo preparing clone DB for the 1.3 upgrade

dropdb lsmb13
rm -f ./LedgerUpg/lsmb-to-1.3.sql

dropuser ledgernew

pg_dump -C lsmbprod > ./LedgerUpg/lsmb-to-1.3.sql

sed -i -e's/lsmbprod/lsmb13/g' ./LedgerUpg/lsmb-to-1.3.sql
sed -i -e's/ledgersmb/ledgernew/g' ./LedgerUpg/lsmb-to-1.3.sql

createuser  --no-createdb --no-createrole --no-superuser ledgernew

psql -f ./LedgerUpg/lsmb-to-1.3.sql

echo Fixing the 1.2 DB in preparation for the 1.3 upgrade

psql --username=ledgernew -f ./LedgerUpg/fix-up-1.2.sql lsmb13

echo Loading the code

cd /usr/local

sudo rm -rf lsmb130/

sudo tar --transform='s/^ledgersmb/lsmb130/' -x -z -f /PATH/TO/projects/thirdparty/LedgerUpg/ledgersmb-1.3.0_rc4.tar.gz

cd lsmb130

sudo perl Makefile.PL
sudo make

echo Load in the local customizations

sudo cp /PATH/TO/projects/thirdparty/LedgerUpg/ledgersmb.conf ./
sudo cp /PATH/TO/projects/thirdparty/LedgerUpg/1.2-1.3-manual.sql sql/upgrade/

cd /usr/local
sudo chown -R www-data:www-data lsmb130

cd lsmb130
psql -s -f sql/upgrade/1.2-1.3-manual.sql lsmb13

#lynx -tlog http://localhost/lsmb13/setup.pl

# contrib: /usr/share/postgresql/8.4/contrib