Migrate scoped app from developer instance to company instance

jason_lau
Tera Contributor

Hi,

If you create a scoped app from a developer instance (organization-code = 12345), is there a way to migrate or convert that application to your company namespace (for example: organization-code=myco)?

Or if you create a scoped app from a developer instance and you want it under your company namespace, do you have to rebuilt the objects into that new namespace?

Basically, I created some scoped apps in a developer instance before we got our company instances and I'd like to see if theres a way to change/migrate the scoped app(s) to new namespace. I'm assuming that even if it's possible there would be some manual search/replace work needed to be done, for example in include script which references a scoped application table (x_12345_appname_tablename, etc).

Thanks!

Jason

1 ACCEPTED SOLUTION

Further investigation says you can update all artifacts by querying table sys_metadata


var gr = new GlideRecord('sys_metadata');  


gr.addQuery('sys_scope','821b35cd4f442200bbc32d118110c7f2'); //sys_id of the first scoped app


gr.query();


while(gr.next())


{


gr.sys_scope = '96784d274f10e600bbc32d118110c7de'; //Update with correct scope i.e newly created scoped app  


gr.setWorkflow(false);  


gr.update();  


}



To round of testing by creating a sample app and updating it to new the app.


View solution in original post

10 REPLIES 10

Chuck Tomasi
Tera Patron

Hi Jason,



There is no automated way to migrate an app from one scope to another. In reality, there's really no need to. If your scope on your personal developer instance was x_123_app, and new apps on your corp instance come with a prefix x_abc, there's no conflict.



if you are really dead set on making things match, export the entire app to an update set, make a copy (for backup purposes) and do a search and replace on x_123_app with x_abc_app. It's totally unsupported, but I've done it once or twice in a pinch.


Thanks Chuck!



Yes, I understand that I wouldn't have any conflict if I just moved my scoped app into the company instance as-is. What I'm trying to do however is to basically migrate the apps into the company namespace.



The context here: I new I wasn't going to get our companies instances procured until end of June, which was two months past original projection. To keep the project on track, I built out a few of the API integrations we would need as scoped apps in a developer instance.



Because, you know after taking your K16 pre-con training class I though I should roll up sleeves and get to building scoped apps sooner than later!



Now that the actual company instances are online, I want to move my scoped apps into the company instances under the company namespace. I don't want some scoped apps to be in a developer instance namespace and onward apps to be in the company namespace, I just want them all to be in the company namespace. Not really to avoid conflict, but to align all company developed apps under same namespace. Hope that makes sense!


Gotcha Jason. Let us know if there is anything we can do. Sounds like you're on the right approach. Create the app scope on the new system, update the update sets with the new scope name and sys_id (or import them and migrate the files.) Personally I prefer a good old editor search & replace in case I have to do the import more than once.


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Jason,



You need to migrate this application to your target instance and then create a new scoped application with the correct namespace.


After that you have to manually update all the metadata files to new application i.e updating sys_scope field to the new application scope record.



P.S : ServiceNow doesn't support this and the recommended option is to create a new application in the proper scope and manually move changes to the new application.


Application Scope - ServiceNow Wiki