The short answer is you cannot and even if you could it would have the opposite effect and make your data file larger.
Moneydance writes data as a series of Additions, modifications, deletions.
So it keeps everything, it does not have a single record of a transaction that it modifies or deletes but rather it records the changes over time as a set of discrete entries. ultimately this could facilitate a rollback facility where you could undo changes in the reverse order.
Tom Freeman on 16 Jan, 2019 10:09 PM
Is the size of your file causing functionality issues. If so then this may indicate another issue.
If there is an issue with your file slowing down any money dance process then please give us the details and send me your errlog.txt file? If you're using Mac OS X, it should be located at one of these locations within your Home folder:
This is the 2nd time I've read that deleting transactions grows the file system so I tested this issue out. I took an old copy of my current data set with 8 years history, noted the file space used, and deleted all checking transactions prior to 2018. Rechecked the .moneydance file size and yes the file system grew. But the folder and file count stayed the same. So I suppose the MD database is like other databases I've used like Oracle and a deleted entry or field is simple marked deleted, but still remain. But with those databases there are tools to strip out old space when files space warrants. Not sure why the file space would grow on MD unless additional data is added to the database to mark the old elements as deleted. So it's true, deleting a large quantity of transactions increases the MD database size. I suppose if you wanted to discard the deleted database space, you would just do a backup export, create a new file name, and restore from backup. But didn't test that theory.
A backup strips out syncing information but as far as I know nothing else.
An export writes out a file, and of the options present you would probably want a QIF file, but that just has your raw transactions, yes I believe it consolidates all entries for a transaction into one but I understand you lose things like reminders, syncing information etc, If I recall correctly it also loses events like stock splits.