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

Re: 1.2 to 1.3 Upgrade fun



On 16/03/2014 22:43, Erik Huelsmann wrote:
Hi Lyle,

Let me start by saying I'm sorry to hear 1.3 is causing you this much trouble. More comments below.

Thanks

On Sun, Mar 16, 2014 at 4:06 PM, Lyle <..hidden..> wrote:
Hi,
  Trying to upgrade from 1.2 to 1.3 has been quite an experience thus far. Luckily I backed everything up and have been able to revert back to the old version.

I followed the upgrade notes:
http://sourceforge.net/p/ledger-smb/code/HEAD/tree/branches/1.3/UPGRADE

The setup.pl script didn't work properly, when I looked at the Apache SQL logs it looked like an issue with the DB.

Centos 5 comes with PostgreSQL 8.1. Seeing that the install notes say 8.2+ I figured that might be part of the problem, so I upgraded to PostgreSQL 9.3 using the packages direct from the PostgreSQL site:
http://yum.postgresql.org/repopackages.php
I also added the EPEL repo to get all of those packages to install.

I restored my backed up 1.2 databases, and the ledgersmb user. setup.pl would then run, but the resultant upgraded database was empty :(

Well, I have to agree this needs to be communicated better -- and 1.4 does a better job at it, I think, albeit that there remains a lot of room for improvement. However, the problem is that we're lacking real world datasets to do our testing on. The datasets that we do get our hands on usually need to stay private for obvious reasons. However, it makes testing upgrades harder.

The thing with the empty database is the following: the old data is still there, but you don't see it. There's a new schema (lsmb12) where your old data is stored. So, you can drop the public schema and rename the lsmb12 schema back to public. That way, you're back where you were before the failed upgrade.

One problem with the upgrade from 1.2 to 1.3 is that the datamodel on 1.3 has been cleaned up and validation rules are a lot tighter now than they ever were before -- ie on 1.2. That makes migration hard. We have a number of checks in place, but probably the checks required for your dataset haven't been implemented yet.

Once I get a 1.3 working I'll look through the upgrade script and amend it to account for my databases. I'll submit patches for this. I'm guessing (hoping) the upgrade from 1.3 to 1.4 will be easier when the time comes?
 
I saw some errors with regards to the ledgersmb users permissions, so decided to remove that user and follow the 1.3 install instructions to create one with the new 1.3 permissions.

That got me a bit further, and there are less errors in the apache error log when I try to upgrade the database:

[Mon Mar 16 10:06:02 2014] [error] [client 192.168.1.10] commit ineffective with AutoCommit enabled at LedgerSMB/DBObject/Employee.pm line 107., referer: http://centos.cosmicnetworks.com/ledgersmb/setup.pl
[Mon Mar 16 10:06:02 2014] [error] [client 192.168.1.10] commit ineffective with AutoCommit enabled at LedgerSMB/DBObject/Admin.pm line 102., referer: http://centos.cosmicnetworks.com/ledgersmb/setup.pl
[Mon Mar 16 10:06:02 2014] [error] [client 192.168.1.10] commit ineffective with AutoCommit enabled at scripts/setup.pl line 1051., referer: http://centos.cosmicnetworks.com/ledgersmb/setup.pl
[Mon Mar 16 10:06:04 2014] [error] [client 192.168.1.10] rollback ineffective with AutoCommit enabled at lsmb-request.pl line 109., referer: http://centos.cosmicnetworks.com/ledgersmb/setup.pl
[Mon Mar 16 10:06:04 2014] [error] [client 192.168.1.10] commit ineffective with AutoCommit enabled at LedgerSMB/App_State.pm line 112., referer: http://centos.cosmicnetworks.com/ledgersmb/setup.pl

But still the upgraded database is empty :(


There are logs in /tmp/ledgersmb which allow you to see which errors occur when setup.pl runs its upgrade scripts. You'll probably find your data is mismatching some data integrity rule.

Thanks for the pointer.

[ snip ]

I renamed the ledgersmb folder and started with a fresh download. Followed the install instructions, reconfigured ledgersmb.conf, then ran setup.pl to create the database as instructed here:
http://sourceforge.net/p/ledger-smb/code/HEAD/tree/branches/1.3/INSTALL
Although these wasn't any option to create a database?

What do you mean by this remark? You mean that loading http://localhost/ledgersmb/setup.pl didn't give you the option to create a new database? If so, that's great feedback! I never thought of requiring a button like that. The process to follow is to enter a name of a non-existing database, click Login and answer "Yes" to the question "Database does not exist. Create it?"

The install file says:

One way you can create databases fairly easily is by directing your web browser
to the setup.pl script at your installed ledgersmb directory.  So if the 
base URL is http://localhost/ledgersmb/, you can access the database setup and 
upgrade script at http://localhost/ledgersmb/setup.pl.  This is very different
from the approaches taken by LedgerSMB 1.2.x and earlier and SQL-Ledger, but
rather forms a wizard to walk you through the process.

Please note that the setup.pl file assumes that LedgerSMB is already configured 
to be able to access the database and locate the relevant PostgreSQL contrib 
scripts.  In particular, you must have the  contrib_dir directive set to point
to those scripts properly in your ledgersmb.conf before you begin.

Trying to login to a database that doesn't exist is counter intuitive and doesn't scream out as a way of creating a database. The instructions above only mention going to that script. Once at that script there is no mention of creating a database.

 
So I tried the prepare-company-database.sh script instead. Which gave me:

[root@centos ledgersmb]# ./tools/prepare-company-database.sh --company testinc
could not change directory to "/home/accounts/public_html/ledgersmb": Permission denied
cat: ignore/tsearch2.sql: No such file or directory
cat: ignore/tablefunc.sql: No such file or directory
CREATE EXTENSION
CREATE EXTENSION
CREATE EXTENSION
UPDATE 86
ERROR:  column "customer_id" does not exist
ERROR:  current transaction is aborted, commands ignored until end of transaction block
ROLLBACK

As you can imagine, from that point on it didn't work.

I've spent a fair bit of time poking with this now. The idea was that I'd get onto the latest version, then contribute some usability enhancements. I've calculated that I'll actually save more time in the long run by adding some JS to prevent common usability problems, than I've been spending fixing mistakes my book keeper makes.

Again, I'm sorry to hear the 1.3 release is giving you so much headaches. In 1.4, we've removed all dependencies on extensions, partly by requiring newer database versions (than are required for 1.3) and partly by rewriting code that depended on them. That makes installation of 1.4 easier. However, since that's not released for general use yet, I wouldn't suggest you use it.

Yeah, I don't want to go there for my real accounts.


Lyle

 


--
Bye,

Erik.

http://efficito.com -- Hosted accounting and ERP.
Robust and Flexible. No vendor lock-in.


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech


_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel