How to update doc name from "/" to "-"?

Hi all,
Previously I setup the naming series by having some “/” and found out it is not best to use. So now I want to change it to “-”. I can change the future naming by updating the naming series but I’m wondering is there a way to update the old document from “/” to “-”?

Thanks.

@maxchock are these files linked to other doctypes ?

There files are Sales Order, Sales Invoice and etc, i believe they are linked to others.

@maxchock actually I’ve checked and it doesn’t matter. open the bench console . list the doctypes using frappe.db.get_list() . you can filter those who has “/” in name . then , for each item of the list use frappe.rename_doc() .
I believe all linked doctypes will rename the linked file . you can try it using one single item .
PS: Rename will only work if Allow Rename is set in the DocType Form.
here is the document API

Thanks for your prompt reply.

I’m currently using Erpnext on Frappe Cloud, any idea how to access the bench console? Or any alternative way to rename them?

Thanks again.

@maxchock you can rename them one by one . using the rename button .

Thanks again.
However, I can’t enable “Allow Rename”, the SAVE button disappeared if I checked the Allow Rename… strange…

And I have too many record now to do it 1 by 1.

@maxchock shoot . you need to enable developer mode .

When logged in as administrator, you should be able to access a page called “System Console”. From there, you can run some python commands.

Thanks, I’ll try from there.