"bench migrate" takes about 8 minutes

Hi,
since migrating to V14 executing “bench migrate” runs several minutes. At first one execution took 4 - 5 minutes, currently it lasts 8 - 9 minutes.

I’m using bench 5.17.2 and have these 4 apps intalled:
erpituc 13.34.0 (our own app)
erpnext 14.39.0
frappe 14.49.0
hrms 14.10.6

Obvious reasons checked:
hooks.py: after_migrate-hook in our app is empty.
patches: run fast and display success message within seconds

Is this normal? If you use V14 I would like to know how long it takes in your environment to run “bench migrate”.
Please reply.

While running “bench migrate” the system is not overly stressed:

@thkr_ituc mine take appr 2 minutes, I have 6 apps in total . I am using vm with 8gb of ram and 1 core.

Hi @thkr_ituc,

Please clear-cache using the below command and then check it.

bench --site [sitename] clear-cache
bench --site [sitename] clear-website-cache

If the problem is not solved remove the whole cache from the system/server.

sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"

I hope this helps.

Thank You!

Hi NCP,
thanks for advice, but this had no effect. What I did:

bench --site [my sitename] clear-cache
bench --site [my sitename] clear-website-cache
bench migrate

bench migrate took about 8 minutes

Then I did

sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"
bench migrate

bench migrate took about 8 minutes.

I will look further into this, any ideas will be appreciated :slight_smile:

Found it. We are working with fixtures and exported 324 custom fields for 33 doctypes. Removing fixtures\custom-fields.json speeds up “bench migrate” to less than 30 seconds.

I also exported all customizations manually:
Went to List View / Form View of desired DocType
Clicked […] > Customize
Clicked [Actions] > Export Customization
Selected my app as “Module to Export”

Then in hooks.py I excluded ‘Custom Field’ from fixtures. For future customizations we will also export manually as described above.