I just ran gnucash-to-beancount but had to do some fiddling for it to work. 
Posting these notes in case it helps someone in the future. (Sorry to 
revive this ancient thread, but it comes up in search results and seems 
like an appropriate place for the information.)

My changes (on top of Andrew's commits) are at 
https://github.com/falsifian/gnucash-to-beancount but you probably don't 
want all of them. Also I had to do one hack which is not included as a git 
commit.

   - I edited setup.py to force piecash to be at exactly version 0.15.0. 
   (Otherwise test.sh fails because newer piecash versions can't read 
   data/sample.gnucash. It would probably be better to update that, but I was 
   having some other issues; read on...)
   - piecash (even newer versions 
   <https://github.com/sdementen/piecash/issues/126>) complained about my 
   GnuCash file, saying "AssertionError: Unsupported table versions". To fix 
   this, I made the following changes *on a copy* of my GnuCash file. (File 
   created with GnuCash 3.8; the values before the changes were 3000010 and 5 
   respectively.)
   - *** DON'T DO THIS TO YOUR MAIN GNUCASH FILE ***
      - sqlite3 (gnucash copy)
      - sqlite> update versions set table_version = 3000010 where 
      table_name = 'Gnucash';
      - sqlite> update versions set table_version = 4 where table_name = 
      'splits';
   - My own quirks / conveniences; you may want to skip these:
   - If you're using nixpkgs, you might find the shell.nix I added 
      convenient. (Just run 'nix-shell' and you'll get a shell where you can 
run 
      the gnucash-to-beancount command.)
      - I changed directives.py so that all the account names now contain 
      "GnuCash". This is the part you are least likely to want. I did it 
because 
      I want to go through all my accounts and rename them if I end up 
switching 
      to beancash, and this will be a way of keeping track of which accounts 
      still have their old names.
      - I added "gnucash_guid" metadata fields to transactions, 
      commodities, prices and accounts (in the "open" directive). I'm not sure 
      whether I'll use these, but they're there just in case. This will tell me 
      which things I imported from GnuCash, and could conceivably be useful if 
I 
      end up making changes to my original GnuCash file and want to see what 
      should be updated in my beancount file.
      

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/59e684d1-532c-4447-b039-f4b66c81fa71%40googlegroups.com.

Reply via email to