Migration of v4 to v5 issue

I am migrating my V4 setup to V5. The steps which i follow are-

  1. I have create v4 setup for my project taking latest code from my github repository.
    2)Then i did developer mode 1 in my site_config.json file.
    3)Then for migrating it to v5 in frappe i have set my origin to my frappe repository path and upstream to ‘GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript’.
    4)Same as frappe for erpnext also i set origin to my erpnext repository and upstream to ‘GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)’.
  2. Then i run the command bench update it gives me message like
    ‘This would take significant time to migrate and might break custom apps. Please run bench update --upgrade to confirm.
    You can stay on the latest stable release by running bench switch-to-master or pin your bench to 4 by running bench swtich-to-v4’
    6)so i run command ‘bench switch-to-master’ it gives me message like ‘Switching to master will cause upgrade from 4 to 5. Pass --upgrade to confirm’.
    7)so i run command ‘bench switch-to-master --upgrade’
    Now, my setup is migrated in V5 but whatever the changes i have done in erpnext (i have added new doctypes ) is not showing under the erpnext app. If i search my newly created doctype from in Doctype List is there but the coding file py and js is not shown under the erpnext app.That means only doctypes are added in DocType List.

Is there anything wrong in my steps?Please guide me.


Did you created Custom DocType in separate custom app?
If not, this will breaks changes.

You can create separate module, and link your custom DocType like this

I have created custom app and all the doctypes and files related to new custom app all are properly coming in version 5 but whatever changes i have done in erpnext app (i.e i have done some customization in HR module added some new doctypes that are linked HR module itself and written code in its py and js file.) but while migrating my all newly created coding files from erpnext app is get removed only doctypes are visible inside the doctype list.

Can you share your hooks.py file in custom app?

Please read this to for managing custom_field, custom script.

Add this to your custom app, export your customization using export_fixture and import it.

fixtures = ["Custom Field",
"Property Setter",
"Custom Script",
"Print Format",

Note: If you modified core ERPNext code(js, py files) then that changes will not migrate while updating.
So manage all customization in separate app.

First of all thanks for your guidance. But my all custom fields are coming in V5 and i have already added fixtures = [‘Custom Field’, ‘Property Setter’] in it.Also i have not modified any preexisting file from Core ERPNext but i have created new doctypes in it.(As i told you i added some customization in HR Module for that i have created new doctypes and linked it to HR Module), Now after migrating it into V5 if i check files from HR module then only preexisting files(like salary slip,employee etc)are there no any new files are present over there.

Do you have any console log at the time of migration?
try restoring v4 database in v4 and migrating again in clean install.

bench migrate should work for synchronizing database schema.