If I am not mistaken, the declarative (layout) API on
organization level should allow you to get everything (all workspaces, permissions etc.) in your environment in a form of single JSON, you can modify the identifier (everywhere where it is used) and post this updated definition back (plus add passwords if needed).
But for sure this approach would be better tested on some non-production environment first. (Also note you might need some passwords as those are not exported).
Or alternatively you can get the layout and use pieces of it (wprkspave definition, permissions, custom objects) to create new workspace with new ID using several individual single-workspace API calls.