How to safely move custom Doctypes and assets (custom=1) into a custom app?

Hi everyone,

I have a question regarding best practices for moving customizations into a custom app.

Context

  • I created several Doctypes via the UI, so they are currently stored as custom=1 in the database.
  • I also have Print Formats, Dashboards, Dashboard Charts, Reports, Client Scripts, and Server Scripts created in the same way.
  • Now I’ve built a new custom app, and I want ERPNext to read all of these from the app instead of the core/DB.
  • The goal is to make sure everything is safe during upgrades, and that I can always pull them back from GitHub if needed.

My question :point_right: What is the correct way to:

  1. Move existing custom Doctypes (custom=1) into my custom app so they become part of the app (custom=0)?
  2. Do the same for Print Formats, Dashboards, Dashboard Charts, Reports, Client Scripts, and Server Scripts?
  3. Ensure that after migration, ERPNext loads them from the app, and I can safely delete the DB-only versions?

Reference I also opened a related feature request on GitHub: #50102 – Add “Move Custom Doctype to App” Option in Developer UI. But until such a feature exists, I’d like to know the recommended manual process.

Goal

  • Keep all customizations version-controlled in my app
  • Ensure they survive upgrades
  • Be able to reinstall them easily from GitHub on a fresh site

Would love to hear from the community: what’s the cleanest and safest workflow you use for this scenario?

Thanks, Ahmed