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

Re: projects lost after importing 1.2.21 backups in 1.3.23



On Fri, 2012-12-07 at 19:25 -0800, Chris Travers wrote:
> Good to know.  I will find and fix today.
> 
> 
> To correct your system, run the following query:
> 
> 
> INSERT INTO project 
> (id, projectnumber, description, startdate,  enddate, parts_id,
> production, completed, credit_id)
> SELECT p.id, projectnumber, p.description, p.startdate, p.enddate,
> parts_id, production, completed, null
> FROM project p WHERE customer_id IS NULL;

Done:

<verbatim>
postgres$ psql dbname
dbname=# INSERT INTO project (id, projectnumber, description, startdate,
enddate, parts_id, production, completed, credit_id) SELECT p.id,
projectnumber, p.description, p.startdate, p.enddate, parts_id,
production, completed, null FROM lsmb12.project p WHERE customer_id IS
NULL;

INSERT 0 144

dbname=#
</verbatim>

Doing 
dbname=# SELECT * FROM project;
came back with 146 rows (the 144 inserted + the 2 already existing), so
that looked promising.

Login in the database through the browser gave:

"Error!
Database is not the expected version. Was 1.3.0, expected 1.3.23. Please
re-run setup.pl against this database to correct.setup.pl
"

Clicking the 'setup.pl' link landed on 'Database Management Console |
Superuser Credentials'. After entering the credentials it landed on
'Database Management Console | Confirm Operation' (Rebuild/Upgrade?) 
Clicking 'Yes', then 'Start Using LedgerSMB' and logging in again, then
'Projects | Reports | Search | Continue' with all fields empty, finally
gave the list with (I think all) the projects!!!!

You did it! :)

Thanks a lot,


ario

P.S. There still is an issue with 'NaN' though, will post that later on.



> On Fri, Dec 7, 2012 at 7:12 PM, ario <..hidden..>
> wrote:
>         On Fri, 2012-12-07 at 18:19 -0800, Chris Travers wrote:
>         >
>         >
>         > On Fri, Dec 7, 2012 at 1:57 PM, ario
>         <..hidden..>
>         > wrote:
>         >         On Fri, 2012-12-07 at 18:22 +0000, ario wrote:
>         >         > On Fri, 2012-12-07 at 03:34 -0800, Chris Travers
>         wrote:
>         >         > >
>         >         > >
>         >         > > On Fri, Dec 7, 2012 at 2:07 AM, ario
>         >         <..hidden..>
>         >         > > wrote:
>         >         > >         Tried, I'll quote the result:
>         >         > >
>         >         > >         <quote>
>         >         > >         ERROR: relation "lsmb12.projects" does
>         not exist
>         >         > >         LINE 1: ..., parts_id, production,
>         completed,
>         >         credit_id FROM
>         >         > >         lsmb12.pro...
>         >         > >         ^
>         >         > >         </quote>
>         >         > >
>         >         > >         ario
>         >         > >
>         >         > >
>         >         > >         On Fri, 2012-12-07 at 00:04 -0800, Chris
>         Travers
>         >         wrote:
>         >         > >         >
>         >         > >         >
>         >         > >
>         >         > >         > On Thu, Dec 6, 2012 at 11:43 PM, ario
>         >         > >         <..hidden..>
>         >         > >         > wrote:
>         >         > >         >         Still trying to get things
>         working.
>         >         > >         >         Re-installed brand new debian
>         6.0.6 and
>         >         ledgersmb
>         >         > >         1.3.23.
>         >         > >         >         Imported the backup of a
>         1.2.21 database
>         >         with loads
>         >         > >         of
>         >         > >         >         projects.
>         >         > >         >         After that, only 2 projects
>         show up.
>         >         > >         >         Strange number in System|
>         Defaults|
>         >         Job/Project
>         >         > >         Number: 11
>         >         > >         >         Both databases (within the
>         same cluster)
>         >         give this
>         >         > >         same
>         >         > >         >         number, although
>         >         > >         >         both have different number of
>         projects
>         >         >> 11.
>         >         > >         >
>         >         > >         >         What's going on, and how can I
>         get my
>         >         projects back
>         >         > >         in 1.3.23?
>         >         > >         >
>         >         > >         >
>         >         > >         >  Hi;
>         >         > >         >
>         >         > >         >
>         >         > >         > I am trying to track this down.  Can
>         you try
>         >         this for me:
>         >         > >         >
>         >         > >         >
>         >         > >         > INSERT INTO project
>         >         > >         > (id, projectnumber, description,
>         startdate,
>         >         > >         > enddate, parts_id, production,
>         completed,
>         >         credit_id)
>         >         > >         > SELECT p.id, projectnumber,
>         p.description,
>         >         p.startdate,
>         >         > >         p.enddate,
>         >         > >         > parts_id, production, completed,
>         credit_id
>         >         > >         > FROM lsmb12.projects p
>         >         > >         > JOIN lsmb12.customers  c ON
>         p.customer_id =
>         >         c.id;
>         >         > >
>         >         > >
>         >         > >
>         >         > > Sorry, my bad, should be:
>         >         > >
>         >         > >
>         >         > > INSERT INTO project
>         >         > > (id, projectnumber, description, startdate,
>          enddate,
>         >         parts_id,
>         >         > > production, completed, credit_id)
>         >         > > SELECT p.id, projectnumber, p.description,
>         p.startdate,
>         >         p.enddate,
>         >         > > parts_id, production, completed, credit_id
>         >         > > FROM lsmb12.project p
>         >         > > JOIN lsmb12.customers  c ON p.customer_id =
>         c.id;
>         >         > >
>         >         > >
>         >         > > In other words, lsmb12.project instead of
>         lsmb12.projects.
>         >         >
>         >         > And lsmb12.customer instead of lsmb12.customer, I
>         realised
>         >         after the
>         >         > same error appeared (no relationship exists) with
>         respect to
>         >         > 'lsmb12.customers'.
>         >         >
>         >         > But still then, after removing the trailing 's' in
>         both
>         >         > 'lsmb12.projects' and 'lsmb12.customers'  it still
>         gave an
>         >         error:
>         >         >
>         >         > <quote>
>         >         > ERROR:  duplicate key value violates unique
>         constraint
>         >         "project_pkey"
>         >         > DETAIL:  Key (id)=(14395) already exists.
>         >         > dbname=#
>         >         > </quote>
>         >
>         >
>         >
>         >
>         >
>         > If you just start at SELECT, how many rows show up?  If only
>         two then
>         > I know what to do to both preventing this from happening
>         again and in
>         > fixing it.
>         
>         
>         That would be nice.
>         Just for your info: Another database from the same 1.2.21
>         cluster had
>         all its projects preserved after upgrading to 1.3.23.
>         
>         Indeed, 2 rows showed up after following your suggestiong as
>         follows:
>         
>         <verbatim (almost)>
>         postgres$ psql dbname
>         
>         postgres=# SELECT p.id, projectnumber, p.description,
>         p.startdate,
>         p.enddate, parts_id, production, completed, credit_id FROM
>         lsmb12.project p JOIN lsmb12.customers  c ON p.customer_id =
>         c.id;
>         
>         
>         id | projectnumber | description | startdate | enddate |
>         parts_id |
>         production | completed | credit_id
>         14395 | <projectnumber> | <empty> | 2011-04-29 |  <empty>   |
>         <empty> |
>         <empty> | 0 | 0 | 317
>         15799 | <projectnumber> | <descr> | 2011-11-26 | 2012-01-18 |
>         <empty> |
>         <empty> | 0 | 0 | 317
>         (2 rows)
>         
>         dbname=#
>         
>         </verbatim>
>         
>         (I hope you read my mail about 'cascaded truncating' the table
>         first,
>         not getting the 'duplicate key value' error anymore, but still
>         being
>         left with only 2 rows in the updated table.)
>         
>         
>         cheers,
>         ario
>         
>         
>         > Best Wishes,
>         > Chris Travers
>         
>         >
>         ------------------------------------------------------------------------------
>         > LogMeIn Rescue: Anywhere, Anytime Remote support for IT.
>         Free Trial
>         > Remotely access PCs and mobile devices and provide instant
>         support
>         > Improve your efficiency, and focus on delivering more
>         value-add services
>         > Discover what IT Professionals Know. Rescue delivers
>         > http://p.sf.net/sfu/logmein_12329d2d
>         > _______________________________________________
>         Ledger-smb-users mailing list
>         ..hidden..
>         https://lists.sourceforge.net/lists/listinfo/ledger-smb-users
>         
>         
>         
>         ------------------------------------------------------------------------------
>         LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free
>         Trial
>         Remotely access PCs and mobile devices and provide instant
>         support
>         Improve your efficiency, and focus on delivering more
>         value-add services
>         Discover what IT Professionals Know. Rescue delivers
>         http://p.sf.net/sfu/logmein_12329d2d
>         _______________________________________________
>         Ledger-smb-users mailing list
>         ..hidden..
>         https://lists.sourceforge.net/lists/listinfo/ledger-smb-users
>         
> 
> 
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________ Ledger-smb-users mailing list ..hidden.. https://lists.sourceforge.net/lists/listinfo/ledger-smb-users