All,
I kept at it and finally got some of what I wanted from gnc20.perl. I've
pasted below a recipe for what I did; perhaps it can save some time and
frustration for others.
In gnucash select File, then Export, then Export Accounts.Name the file
gnucash.xml and select a folder to save it in. I saved it in /tmp, where I
had already placed gnc20.perl. This will simplify things. Click on the
Export button.
Go to where you've saved the export and gnc20.perl. I made gnc20.perl
executable (chmod 755...) but perl is an interpreted language so I don't think
this is necessary. Then do:
perl ./gnc20.perl
and the output should stream by on the screen. Next, repeat the command but
redirect that output to a new COA:
perl ./gnc20.perl > foobar-chart.sql
This should work fine. If it doesn't check permissions and ownerships; but
if you're using a UNIX or variant you should already know all about that
stuff, it's usually the first thing to bite a newbie user. Move
foobar-chart.sql to your sql-ledger directory and place it in the sql
directory. Adjust the permissions and ownership to match the other
*-chart.sql files in there.
Log in to sql-ledger as admin and create a new dataset using
foobar-chart.sql (it should appear in the list) and edit your usual user
to use that dataset. foobar-chart.sql is just a list of sql insert
statements that will be used by the database to create the various tables
in the new dataset. That's it, alas. I was hoping it would magically
import the actual data as well but it doesn't look like that is the case.
You'll likely have lots of account re-numbering to do too if you didn't
give your gnucash accounts numbers; like I didn't. The script looks for
gnucash.xml for its input file but you can edit that easily to look for
any file, it's right up by the top of gnc20.perl. Look for "gnucash.xml".
I'm not going to clean up my COA until I can import all my data. That way
everything will be the same numbering scheme (if gnc20.perl and any future
data import script think alike.) Until then I'll stick with gnucash and
see what happens. In the meantime, sql-ledger looks pretty nice and I can
always psql right into the tables themselves, something I understand much
better than XML, or perl.
HTH somebody.
r
|