How to Duplicate Scoped application with a different namespace

eduzol
Tera Contributor

Hi Team,

For the purposes of experimentation of new features, I would like to duplicate an existing application on the same instance, but with a different namespace.

For instance, Application1 with scope x_wdp_app1 should be Application2 with scope x_wdp_app2.

Can you please show me how to do it?

Thank you.

3 REPLIES 3

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Eduardo,



Can you provide some additional details on what you are trying to accomplish?


To answer you question, We don't have any utility to copy the application. You have to manually create another application and then manually copy all the artifacts.


raking08
Kilo Expert

Hello 

I totally understand what you are trying to do amd now that I need to do the same I am wondering if you found a simple solution

if so can you share here?

thx

richard

phs
Giga Contributor

I have done this manually several times. I do it when I create and test an app in a personal developer instance before bringing it to the client instance.

I found your question because I am looking around to be sure someone hasn't already put something on Share that does the same thing..

I do roughly the following:

  • Create a new target app in the target instance.
  • Dump the source app to XML.
  • Edit the XML:
    • Substitute the scope prefix.
    • Change the App record name.
    • Change the App record Sys IDs to match the target app.
    • Load the App XML on the target instance.

This works ONLY if you never try to load both apps on the same instance. The rest of the update Sys IDs conflict.

I was thinking of generalizing this further by replacing all Sys IDs in the XML. One way to do this would be to spit out a few thousand new Sys IDs to a file, then write a Perl script to map new Sys IDs to each Sys ID in the XML file. The other way would be to write a UI Action on Update Set that does the same thing.

With this additional work, you could go beyond changing the scope name and copy template scoped apps. This would be a cool way to reuse design patterns. It overlaps with the New App menu choices - it would be nice if there was a mechanism to extend that menu in Studio.