Migrating doctype to different app

I have custom application A and application B. I want to move all doctypes and customisations from application A into B and then uninstall application B.
What’s the safest way/steps to do this migration in a safe way so that in don’t loose all data in database table with those doctypes.

I hope I am not too late.

If both the App that is A & B are installed on the same site then follow these steps.

  1. Open DocType
  2. Locate your DocType and edit it
  3. In the Settings select a different Module (in your case - choose Module B)
  4. Save the DocType

Do this for all DocTypes and you are done.

Hope this helps.

I try to move my custom doctype (which I originally created in the “buying” module) to my custom app. When trying the method of @YogiYang I get the following error:

grafik

developer_mode is set to 1, and I get the feeling I might have to recreate my custom doctype and assign it to my custom app directly.

Anybody got an idea if I can do something else to move the doctype to my app?

@julez Do customization and export to your custom app.

Now I think what you mean is the “Export Customizations” that can be used for original erpnext apps and transfer the changes this way like this:

However this does not work for a custom doctype unless I overlook something:

When changing the module from Buying to my App, I get the error from above.
By the way thanks for your fast reply!

Also @Kiranmai I cannot edit the custom doctype like a standard doctype:

You got an idea what I can do in this situation exept for recreating the custom doctype?

@julez Make sure that developer mode is enabled

@julez

Or you can also do it like ::

  1. Goto doctype list and open the doctype you want to migrate to another app.

  1. Change the module here and save it.

Make sure developer mode is enabled.

1 Like

Your approach works for standard erpnext/frappe doctypes but not for my custom doctype.
Since my custom doctype I am talking about was created a few months ago with dev_mode=0 the doctype was not implemented as code but in the database itself. I might be mistaken but I think that is the problem. Now with dev_mode=1 and as demonstrated in my 2 posts before I was not able to change my module because then I get the error:

grafik

Also here you can see the “Actions” button is missing for custom doctypes:

I think I will have to recreate the doctypes, this time with development mode set to 1.

Again, thank you @Kiranmai

If you have already made a custom doctype before enabling the developer mode… and if you want to bring it to your custom app, follow these steps…

  1. enable developer mode using bench set-config -g developer_mode 1 or manually by editing

site_config.json

file frappe-bench/sites/{your site}/site_config.json

  1. Clear cache by running

bench clear-cache

  1. make any changes in your custom doctype. like unchecking the custom checkbox in your doctype settings.

  2. Save changes. you can see the doctype is exported to your custom app.

Thank You. Hope this helps.