How to build a holistic and docker-based software lifecycle for ERPNext Apps and Changes

All business data (Item Groups, Items, Variants, Customers, Suppliers) exists exclusively in the SQL database. Pretty standard practice for ERPs, in my experience.

To move that business data between environments (test, staging, production), you can either:

  1. Migrate the entire database (SQL backup + restore)
  2. Use the Data Import/Export tool to move individual DocTypes and specific document records.
  3. Write your own scripts to export and import your data.

The DocType metadata is stored in 1 of 2 places:

  • If “Custom” is flagged? Then the DocType/DocField metadata is only stored in SQL records.
  • Otherwise if not Custom (Standard is true), then metadata is stored both in SQL records and JSON files.

If you have your own App, and you want that App to create Custom fields in the Frappe/ERPNext DocTypes? For example, add a new column to Item Group, or Supplier?
In that case, you can use the fixtures feature to migrate those metadata changes.

This is personal judgement call we all have to make.

The more complex and extensive your modifications become? The more I’d recommended creating your App and DocTypes, instead of modifying the existing ones.

Other Thoughts

The Forum Community has historically recommended that everyone:

  1. Do not edit Frappe/ERPNext code directly,
  2. When possible, use the “Customize” feature to achieve your goals.
  3. If that is not sufficient, try using Server Scripts and Client Scripts.
  4. Otherwise, write your own Apps to handle everything else.
    (if necessary, taking advantage of features like “hooks” and sometimes guerilla patching).

If the above isn’t sufficient, you can always just fork everything, and maintain all your changes in git. That’s what I’ve been doing for a very long time. :man_shrugging:

Choose your own adventure!

4 Likes