How to Migrate Past Profit & Loss Amounts into ERPNext Accounting?

Hello Friends,


We’ve been trying to migrate bookkeeping for a small basic property company from a soon to be archived legacy system into ERPNext’s Accounting system…

Our Chart of Accounts is completely setup… We have:

  • Assets as Debit Accounts reporting to the Balance Sheet

  • Liabilities as Credit Accounts reporting to the Balance Sheet

  • Revenues as Debit Accounts reporting to the Profit & Loss

  • Expenses as Credit Accounts reporting to the Profit & Loss

We’ve been trying to input year-ending Account balances for both FY2021 and FY2022. Doing this for Assets & Liabilities is easy, and our Balance Sheet looks perfect. We simply created Opening Journal Entries (JE) with the correct Posting Dates for each year and input all the applicable Debits & Credits.

However, we’re running into alot of frustration with JEs for the Revenues & Expenses…

I don’t understand why we can’t just tell the system what a Revenue or Expense account’s ending balance for a past year was??? This should be simple to perform for purposes of migration from legacy systems while still retaining the historical record.

Trying to do this through a JE just yields the error:
Journal Entry ACC-JV-2023-0000x: 'Profit and Loss' type account 'x' not allowed in Opening Entry

Our Troubleshooting:

Looking at the documentation, nothing is mentioned about how to import opening/ending balances for P&L-type Accounts, like Revnues & Expenses.

There’s only 1 other forum topic related to this issue, however it does not provide much insight into this.

The Chart of Accounts Importer does not allow you to specify closing balances by ending Fiscal Year for Accounts…

The Period Closing Voucher does not allow you to specify a P&L Account, nor does it allow you to specify a balance.

There must be a way to import old data to accurately supply the P&L Statement… I’m just not understanding why this is so difficult? Supplying legacy P&L data to the system is a very necessary function of a bookkeeping migration, is it now?

The beginning of the Accounting documentation does not explain what options you have for importing in past Revenues and Expenses.

Possible Only Solution?

I’m thinking to only way to achieve what we want without painstakingly going through and re-creating from scratch all invoicing and payments history from past years is to use the Import Data tool and import a CSV full of Journal Entries and have it force submission on import. However, when you start an Import for this, the template seems a bit messy? Accounting Entries appear to be nested underneath the Journal Entries on the same spreadsheet as proceeding child rows. I suppose we will start experimenting with this, forcing our own JEs via Data Import and see how it goes…

I can’t believe something like this isn’t documented or discussed much yet? What am I not understanding? How are other people migrating their company data with inclusion of past years P&L such that you no longer need a legacy bookkeeping side-by-side the ERPNext one for purposes of historical record?

We still have no good explanation as to why Profit & Loss-type Accounts aren’t allowed to be on Opening Entry JEs for past years/months?

In my opinion I do not think you should be importing entries for P&L accounts for a past fiscal year, mainly because ideally, at the end of every fiscal year, the P&L accounts would be closed and the difference would be posted to the retained earning account.

I would advise that any journal posted into a P&L account should not have “Is Opening” Checked.

What about running reports, such as a Balance Sheet that compares last year compared to current year? I don’t understand how you’re supposed to migrate past values from a legacy system…

I wish someone could just tell me this simply isn’t possible… - that you must start using ERPNext for present-day and future accounting. - That it’s not capable of filling in your past year ending data.

We’ve tried everything and just cannot seem to bring in past years’ data without hitting restrictions.


We had a customer for which we had done this exercise a while back and here is a blog post on this that you may find helpful.

In a nutshell, you are correct that everything has to be done using Journal Entries when you are doing a transaction level migration for legacy data that goes back a few years.