syncing two pcs

hendrik at topoi.pooq.com hendrik at topoi.pooq.com
Sat Aug 16 10:01:41 EDT 2008


On Sat, Aug 16, 2008 at 08:09:01AM -0400, Mike or Penny Novack wrote:
> 
> >On July 6, 2008 09:37:45 pm Paul wrote:
> >  
> >
> >>Does anyone know if/how gnucash can be run on two pcs and sync them
> >>together?  I have duplicated both pc's file structures for the
> >>application but only one actually contains data.  Any help would be
> >>appreciated.
> >>
> >>    
> >>
> >
> >I just use rsync on both machines, and copy the file from the office machine 
> >to the laptop if it's the last one I updated. If I updated the laptop last, I 
> >just rsync in the opposite direction, and copy files from the laptop to the 
> >office machine. No muss, no fuss. Available on pretty much any distro.
> >
> >  
> >
> I'm not sure how what I am about to say will be taken.
> 
> If the data (the files) are on both machines and you depend upon 
> synching them by .......
> 1) After using the application on machine A copying the data to portable 
> media like a USB drive.
> 2) Before using the application on machine B "synching" the data from 
> the USB drive to machine B
> SOONER OR LATER you will forget and be screwed.
> 
> Far safer to have just ONE copy of the books (not counting backup copies 
> of course) left on the USB drive and then neither machine can alter the 
> data unless the USB drive is mounted to that machine -- if you forgot to 
> mount the UBS drive you'd get a "not found" looking for the files (the 
> directory in which they lived wouldn't appear in the "open" menu.
> 
> That I have this point of view is because that's the sort of problem 
> that used to come to my desk -- when somebody forgot and now an ad hoc 
> program had to be written to somehow merge the data (in my work context, 
> would be tens of thousands of transactions so one hell of a job to get 
> the data merged "by hand"). Best not to have a "system" dependent on 
> somebody never forgetting a vital step.

This makes it plain that the gnucash database needs to be in a file 
format that can reliably be processed by a revision cotrol system, 
preferably a distributed one, probably a special-purpose one.

All reliable miltoway sync operations need to have, in addition to the 
two files to be merged, a previous version that was the ancestor to 
both.  This means either multiple copies of the gnucash database, or 
having the database itself contain its history.

Most revision control systems maintain multiple working copies of the 
up-to-date versions, and save space by storing the rest as deltas.
It is usually these deltas that are used to compute the changes made 
since the base version, so that the sets of changes can be merged.  In 
the available revision control systems, the deltas are usually 
insertions and deletions of lines in the file, with mistakes repaired by 
hand.  Gnucash files are not particularly line-structured; that's 
why I said above that it would probably need a special-purpose sync 
tool.

What would have to happen to gnucash to make this work easily:

Every transaction and account would have to have a unique ID that can be 
used to determine which transactions in the several versions are the 
same.  If a transaction is changed, its unique ID stays the same.  This 
makes it easy to identify changes to a transaction.

There are probably other entities that will have to be identified by 
such unique IDs.

When edits conflict, the entities will have to be marked some way for 
manual resolution.  This manual resolution will have to be integrated 
with the normal gnucash user interface.

-- hendrik


More information about the gnucash-user mailing list