We developed a new Intranet on a o365 SharePoint site collection name Intranet-test and soon will clone the site and rename it intranet. How can we rename all references to intranet-test to intranet in all lists, libraries, and web parts? The tools available to use are the REST API, powershell pnp, SharePoint designer, and Metalogix.
For the SharePoint Online, you can't rename site collection URL.
As a workaround, you can create a new site collection and migrate content from old site collection to new site collection using Metalogix(If you can use it). Or backup site using "Save site as template" and restore in the new one.