Metadata File

From GnuCash
Jump to: navigation, search

Metadata relating to a book (including window positions, sort orders, which columns to show, CSV import presets,...) is saved in directory Configuration_Locations#GNC_DATA_HOME in a file named

<BOOK-WITH-EXTENSION><optional _NUMBER>.gcm

For example MyBook.gnucash.gcm

In this example <BOOK-WITH-EXTENSION> is MyBook.gnucash and <optional _NUMBER> is not used.


Each book contains a book guid (globally unique identifier). E.g.

<book:id type="guid">fe06ec827c69b29977e25a7c6c090229</book:id>

Each metadata file also contains a book guid E.g.

BookGuid=fe06ec827c69b29977e25a7c6c090229

A metadata file applies to the book(s) with the same <BOOK-WITH-EXTENSION> and book guid.

If there are 2 or more books with the same name (they would have to be in different directories) and different book:id's, then there will be a metadata file for each combination of the book filename and book guid. Metadata file names are made unique by adding <_NUMBER> to them. For example

MyBook.gnucash.gcm
MyBook.gnucash_2.gcm
MyBook.gnucash_3.gcm

When File, New is used from within GnuCash, a new book:id is generated. A new book:id is not generated if

1) you use File, Save As from within GnuCash
or
2) outside of GnuCash, you create a new book by copying an existing book data file.

Therefore, you can opt to have a common metadata file for multiple books with the same name, by using either method 1) or 2) above for creating a new book. Alternatively, if you wish to have a unique metadata file for each book, it is only necessary to ensure the book names are unique.