Exporting from one gnucash file and importing into another

Dale Alspach alspach at math.okstate.edu
Mon Jan 27 09:56:37 CST 2003


If you have xml tools, are willing to write a script or there are not too
many transactions you can cut and paste the transactions from one file to
another. This assumes that the new file has the same accounts with the same
IDs. This happens if you exported the accounts to create the new file. If
not you will need to change the IDs for the accounts and that could be
messy.

First work on copies not on your active files in case disaster strikes.

Assuming the account IDs have not changed, find the xml that describes the
account "savings". Find the ID. Then search for all transactions that
affect that account. ( You could just grep for them.) The next step
requires a decision. What are you going to do with the effects on the other
accounts? If you do not want the other accounts affected, you may want to
add an equity account in the target file and change the other account IDs
to the ID of that equity account. If you want the other accounts to show
the transactions, you can copy them as is into the new file. Be sure that you do
not damage the xml. You must take the entire transaction.

I am not one of the developers so I may be wrong about some details here.
Also this is definitely a process where you want to carefully check everything.
Probably a test with one transaction is the first step.

If you try this, I would be interested in hearing if it was successful or
not. I have successfully done some "copying" this way for a small number of
transactions, but I did not need to change IDs.

Dale Alspach




More information about the gnucash-user mailing list