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

Re: 1.2 to 1.3 Upgrade fun



Hi Lyle,

 
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?


 Absolutely. The 1.3 and 1.4 data models differ only slightly and definitely don't introduce as many new data requirements as the 1.3 data model does in comparison to the 1.2 model. The problem however is that in order to prevent the data issues that are possible with 1.2 and before, could not be eliminated without more strict data restrictions to reject invalid input early.
 
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.


I'll make sure we add a button to 1.4 and 1.3 to help resolve this ambiguity and add some wording to the install file.
 
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.


Thanks for your feedback so far! If I can help e.g. through IRC, please let me know! 

--
Bye,

Erik.

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