[GNC] How to remove oldest transactions

pyz01 at cox.net pyz01 at cox.net
Sat Dec 18 11:45:32 EST 2021


Marc -- 

First decide if you want to keep the old transactions in an archive file.
If yes, then you will have 2 files, one of the archived transactions and one
with the latest transactions.  If you decide you do not want the old
transactions, then you can just delete the old ones from your current files.


Now -- deleting several hundreds or thousands of transactions can be
painstaking -- so below is what I did: 

For me I made a copy of my current file.  Then on the copy I deleted any
transaction after 1/1/2019 (chose any date you want).  This file now becomes
an archive file.  Now re-open my current file.  Delete any transactions in
it prior to 1/1/2019.  Before deleting, make note of account balance amounts
so I can make sure I am balanced once I delete.  Enter new "Opening balance
amounts" as needed to ensure balances are current and balanced.  Now I have
a file with just the last 2 years transaction.   Did a search on the net and
found this: 

"As a workaround I made a shortcut key for deleting transactions. I modified
the C:\Users\username\.gnu-cash\accelerator-map file (with gnucash closed)
by changing the line

; (gtk_accel_path
"<Actions>/GncPluginPageRegisterActions/DeleteTransactionAction" "")

To:

(gtk_accel_path
"<Actions>/GncPluginPageRegisterActions/DeleteTransactionAction"

"<Primary>Delete")

Now I could delete transactions by pressing ctrl+delete. Pressing and
holding this key combination allowed continuous deleting at a predictable
rate so it was quite easy to delete a few hundred transactions quickly.

Might not be the best solution if you have many thousands of transactions
that you want to delete but for a few hundred it was quite painless.

As a follow-up to this very useful info, on a Windows PC, the file is
located in:

C:\Users\UserName\AppData\Roaming\GnuCash\accelerator-map

The way the edited line is displayed in the above answer is correct but it
may not be immediately obvious to everyone that like some other languages,
the semicolon needs to be removed as well. The semicolon is a comment tag
that disables the line it is on.

Notes:

<Primary> is the same as "Command" on macs and "Ctrl" on Windows. Other
modifiers are <Shift> and <Alt> and they can be combined so to make it a bit
more difficult to do accidentally, my new line is:

(gtk_accel_path
"<Actions>/GncPluginPageRegisterActions/DeleteTransactionAction"
"<Primary><Shift>Delete") 

AKA: Control + Shift + Delete

This works in all versions of GNUCash for Windows (what I am using).  If you
need or want to delete multiple transactions - this is very handy.  

The end result for me was two files -- all older transactions in one file --
and all transaction from a particular start date to now. 

Ken


-----Original Message-----
From: gnucash-user <gnucash-user-bounces+pyz01=cox.net at gnucash.org> On
Behalf Of Marc Lacroix via gnucash-user
Sent: Saturday, December 18, 2021 8:24 AM
To: gnucash-user at gnucash.org
Subject: [GNC] How to remove oldest transactions

I am using gnucash for many years, and the database is becoming huge.

Is it possible to remove the oldest transaction?

How?


_______________________________________________
gnucash-user mailing list
gnucash-user at gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.



More information about the gnucash-user mailing list