[GNC-dev] GnuCash 3 on Linux

Chris Good goodchris96 at gmail.com
Fri Feb 8 04:04:55 EST 2019

-----Original Message-----
From: Geert Janssens <geert.gnucash at kobaltwit.be> 
Sent: Wednesday, 6 June 2018 12:10 AM
To: gnucash-devel at gnucash.org
Cc: Chris Good <goodchris96 at gmail.com>
Subject: Re: [GNC-dev] GnuCash 3 on Linux

Op dinsdag 5 juni 2018 14:53:44 CEST schreef Chris Good:
> Hi,
> I'm working on my BackupGnuCash stand-alone app.
> I have 2 questions today:
> 1.
> I'm a little uncertain about where the saved reports and metadata 
> files are in GnuCash 3.0 for Linux.
> I suspect they are by default:
> ~/.local/share/gnucash/saved-reports-2.4
 2.8, not 2.4. If not 2.8 file is found, gnucash 3 and up will search for a
saved-reports-2.4, but it will only save to saved-reports-2.8.
> ~/.local/share/gnucash/books/[BOOK].gnucash.gcm

Yes. Do note it can be [BOOK].gnucash_<number>.gcm if you have several data
files named [BOOK]. And the gnucash part in that file name is only there if
the data file is called [BOOK].gnucash. Older versions of gnucash also
allowed to save to files without extension or with the .xac extension.
So it's really [BOOK-WITH-EXTENSION]<optional _NUMBER>.gcm

> unless overridden by XDG_DATA_HOME.
If you override XDG_DATA_HOME the files will be searched for and saved in

However this can be overridden even with GNC_DATA_HOME. If that's set,
gnucash will search and save in $GNC_DATA_HOME (which may or may not end in
"/gnucash" unlike the XDG_DATA_HOME to which gnucash will always append



Hi Geert,

Thanks very much for the above info.
I'm afraid it has been quite a while since these emails but hopefully now I
have a chance to follow up.

I was surprised to learn about the <optional _NUMBER> part of
[BOOK-WITH-EXTENSION]<optional _NUMBER>.gcm as I have never seen this.
I did some testing in Windows & Linux and I think I realise now how it

There is a guid in both the main data file and the metadata .gcm files.
For example,
In main data file:
<book:id type="guid">fe06ec827c69b29977e25a7c6c090229</book:id>

In .gcm:

So when the metadata is saved, GnuCash looks for (or creates)  a .gcm file
with a BookGuid matching book:id.

It seems that when you create a new book by using File, New, the
subsequently saved main data file has a new book guid created.
However, if you create a new book by either:
1) manually copying a main data file to a different directory and/or
2) using File, Save As 
there is no new book:id created so both books will continue to use the same
.gcm file.

I suspect there may be people who may like to have different settings for
different books but don't because they have created their new book by either
of the 1) or 2) methods above.

As the book:id guid only appears once in my main data file, I assume it may
be possible to correct this situation by:
a) save the main data file uncompressed
b) make a minor random(ish) change to the guid using a text editor (do NOT
change the length of the guid)
c) copy the old .gcm to a new .gcm (i.e. copy TEST.gnucash.gcm to
d) use a text editor to change the old guid to the new guid in the new .gcm

I'd like to document this in the wiki.
Can you please let me know if I have made any errors in my above assumptions
or forgotten anything important?

I think it would be useful if 2) above was changed so that a new book:id is
generated. Shall I raise a bug?

Chris Good

More information about the gnucash-devel mailing list