CI/CD Pipeline for transfering settings


I’m new to ErpNext and looking for a good how to guide to setup a CI/CD Pipeline for transfering the settings. For Example I want to test new settings for a new process on my Stage-System and want to make sure that all settings that were made their are transfered correctly to live. I looked around and asked google but only found CI/CD examples for source code but never for settings.

Thanks in advance for your help!

Can you clarify what you mean by “Settings”? The standard approach for customizations is to use an app, which can be updated from staging to production with a bench update command. If you’re talking about doctype data like Salary Structures or BOMs, it gets a bit messier.

I mean for example tax settings. Or settings like additional warehouses added or setting up a webpage all things that are stored in the database.

And if I try to figure out by myself it might get destroyed with the next release of ErpNext when structure might be changed. So looking for an offical way of doing such things.

At an architecture level, ERPNext does not make any functional distinction between data and settings, so there is no one-click method for migrating just settings between two installations. It should be possible to build a diff function for specified doctypes, but it would take some custom work.

In the meantime, the data needs to be migrated manually. That could be done with the import/export tools, or possibly with Event Streaming.

One alternative is to create custom bench command in your custom app that take inputs and generate settings for environments. The command can be made to create, overwrite or update settings as per your case. Execute this bench command with input params/file during your CI run.

We manage this based on custom apps by implementing hooks:

  • use fixtures (for configurations) and relevant data
  • “seeds scripts” (for basic configurations executed as part of after_migrate hook).

Make sure all systems are in “production mode” and permissions are set so that no one will do any customizing/ configurations/ settings in subsequent environments. This means that new settings must be moved from system to system by the regular CI/CD steps.

1 Like