GnuCash creates several types of files to help ensure that your data is not lost. If you look in the
folder where your saved file resides, you may see other files generated by
GnuCash with the
.LNK in the same directory as your primary
data file. What each of these files does is presented below.
The following sections are relevant only if you are saving your financial data in the XML format
$ ls myfile.gnucash myfile.gnucash.20100414185747.gnucash myfile.gnucash.20100414223248.log myfile.gnucash.20100415114340.gnucash myfile.gnucash.20100415154508.log myfile.gnucash.20100415173322.gnucash myfile.gnucash.20100415194251.log myfile.gnucash.7f0982.12093.LNK myfile.gnucash.LCK
Each time you save your data file, a backup copy will also be saved with the extension
.YYYYMMDDHHMMSS.gnucash. This backup file is a complete copy of your
previous data file, and the filename format refers to the data file, year, month, day and
time of the backup. For example, the filename
myfile.gnucash.20100414185747.gnucash indicates this is a backup copy
of the file
myfile saved in the year 2010, April 14, at 6:57:47 p.m.
To restore an old backup file, simply open the
with the date to which you wish to return. Be sure to save this file under a different name.
Each time you open and edit a file in
GnuCash creates a log file of changes you have made to
your data file. The log file uses a similar naming format as the backup files:
.YYYYMMDDHHMMSS.log. Log files are not a full backup of your data file
- they simply record changes you have made to the data file in the current
In case you exit
GnuCash inadvertently, possibly due to a power outage or a system wide crash, it is
possible to recover most of your work since the last time you saved your
GnuCash file using
this log file. This is the procedure:
Open the last saved
Go to→ → and select the one .log file with the same date as the saved file you just opened. Make sure that you picked the right .log file, or you will possibly wreak havoc in your accounts.
Log replaying will recover any transaction affecting the balance entered since the last save, including those created from scheduled transactions and business features (invoices, bills, etc.).
Changes to the scheduled transactions, invoices or bills themselves are NOT recovered, and their transactions that were recovered may not be properly associated with them, and should thus be double-checked. Especially for business transactions, you may have to delete and re-create some of them. If you do not, although the balance will be correct, some reports may not.
You may occasionally see
.LCK files appear. These
do not store any data, but they are created to prevent more than one user from opening the
same file at the same time. These files are automatically created when you open the file, to
lock it so no one else can access it. When you close your
GnuCash session or open another
GnuCash unlocks the first data file by deleting the
GnuCash crashes while you have a data file open, the
.LNK files are not deleted. The next time you try to open
will get a warning message that the file is locked. The warning message appears because the
.LCK files are still in your directory.
It is safe to choose to open the file, but you should delete the
.LCK files (using a terminal window or
your file manager). Once those files are deleted, you will not get the warning message again
So which files should you keep around? Keep your main data file, of course. It’s a good idea
to keep some of the more recent
.YYYYMMDDHHMMSS.gnucash backup files,
but you can safely delete the
.log files since they are not complete
copies of your data.
If you upgraded from a
You should also delete any
.LNK files that you
see after closing
GnuCash. If you decide to back up your data file to another disk manually,
it’s enough to back up the main data file - not the
.YYYYMMDDHHMMSS.gnucash backup files.