moneyguru icon indicating copy to clipboard operation
moneyguru copied to clipboard

convert GnuCash DB to moneyguru format

Open hsoft opened this issue 11 years ago • 3 comments

How about support for migrating from GnuCash to moneyguru?

I have a year and a half of data in GnuCash SQL DB (mysql) and I wanted to see what it looks like in moneyguru, so I wrote a little ~150 line python program:

https://bitbucket.org/DanC/quacken/src/7f6743d7bfd0/gctomg.py

It works reasonably well. Share and enjoy.

I found a few cases where moneyguru's format doesn't seem to be as expressive:

log.warn('moneyguru account groups do not nest.')
    log.critical('multi-currency accounts! %s', multi_currency_accounts)
    log.critical('%s accounts named: %s', a[0], a[1])  # i.e. multiple accounts with same name
        log.warn('account: %s type %s converted to moneyguru %s',  # e.g. EQUITY
        log.warn('account type mismatch: %s[%s] in %s[%s]',  # e.g. liability under asset

hsoft avatar Jun 22 '13 16:06 hsoft

That's an interesting script, thanks. I don't know about integrating it into moneyGuru. Could this script support most of GnuCash files? Can GnuCash file be stored in another format than MySQL?

As for the problems you mention, I have a couple of answers/questions:

  1. See #161
  2. What is a multi-currency account in GnuCash? What does it mean? In moneyGuru, any account can contain any currency. The currency property is there to define how its balance is calculated.
  3. I wonder how GnuCash manages multiple accounts with the same name. It's problematic when the user types in the name of an account to link to a transaction and that this name is ambiguous.
  4. Yeah, lack of an equity type is a shortcoming. See #23. I would convert Equity to Liability rather than Asset. It's a bit more fitting conceptually.
  5. I don't understand how that's a problem with moneyGuru. So in GnuCash we can have a liability account under the Asset group?

hsoft avatar Jun 22 '13 16:06 hsoft

  1. Yes, I eventually found #161. Good to see it's on the list.
  2. In GnuCash, currency is a property of a transaction, not an account. I'm sure that the case where all transactions in an account use the same currency is common; it's certainly the case for me (I only use USD). So my script just warns in case any account has transactions from more than one currency.
  3. In GnuCash, account names are just labels; the real name/identifier is a guid. The two-accounts-with-the-same-name issues happened to me because I have something like Misc. under Housing Expenses and another under, say, Entertainment.
  4. Ah. good to see it's on the list again. And right... after I ran the script, I discovered that Liability would have been the better choice.
  5. Yes, in GnuCash, you can have a liability account under an asset account. e.g. I have an account called Real Estate, and I put both the value of the house and the mortgage; it lets me see my home equity at a glance. It's probably sloppy accounting, and something I could do without.

Modulo those issue, yes, I think this script handles all GnuCash transactions/accounts/splits, provided they're stored in GnuCash's SQL store.

GnuCash's default storage mode is XML, much like moneyGuru. It would be reasonably straightforward to convert using XPath in place of SQL, but I'm not really motivated to do that. (I included "DB" in the description of this issue to suggest that converting GnuCash's XML format would be a separate issue.)

I haven't tried converting budgets. I don't completely understand how moneyGuru's budgeting works yet, but my vague sense says that it lacks much of the expressivity of GnuCash budgets. GnuCash lets you look at retrospective budget-vs-actual, for example.

GnuCash also does invoices and various other things that I wouldn't expect to be able to convert to moneyGuru.

As to integration... I'm not sure what to suggest. Maybe I'll write a blog item and you can link to it from an appendix in your documentation. Or maybe just this item in the issues list is helpful to some users.

hsoft avatar Jun 22 '13 16:06 hsoft

Regarding 2., moneyGuru works the same way. That's why I'm wondering about the "multi-currency accounts!" warning.

hsoft avatar Jun 22 '13 16:06 hsoft