I have a Managed Beta Package in Dev. Org. with a Namespace. How can I rename the Namespace in the same org. I'm trying to avoid opening a new Dev. Org and migrating components and code to the new Org.
To work with multiple namespace, it is a good idea to have two separate folders, one without namespace (unmanaged code) and another with namespace (managed packaged code) and create script to prepend namespace where it is appropriate (wipe out packaged folder, copy unpackaged folder to packaged and prepend namespaces where needed).
In such case, change of namespace is a simple configuration change in
sfdx-project.json file for 2GMP and rerunning the script to prepend namespaces.
However, for 1GMP you still have to create a separate Dev Edition org and migrate code there manually.