Custom permissions are being reset after bench migrate command

I am having issue with permissions being reset after every time executing “bench migrate” command.
I haven’t made any change in frappe/erpnext app, but still frappe framework is somehow resetting all of my custom permissions.

I am on Version-14 for both frappe and erpnext app.

Any clue or suggestion would be highly appreciated.

try bench export-fixtures before you migrate?

You might also need to include the aspects of the doctype you want to preserve in you hooks file

fixtures = ["Custom DocType", "Role", "Custom Field", "Property Setter", "Print Format"]

@Shaun appreciate your response!

I’ve also thought of this solution but we have dev servers also where we use bench export-fixtures command as well but I don’t want to export/override the custom permissions on our production server.

I might need to use database flag in order to differentiate the production server from dev servers so that on dev server bench export-fixtures command doesn’t export “Custom DocPerm”.

Thanks tho for your solution.