I recommend copying the properties manually via sys_properties. Go to the list, locate your old property with the old value, copy the value, switch app scopes, create a new property with new suffix, description, type, and paste in the value.




Once copied, the values are available to your scripts with the gs.getProperty() call


Hi Chuck,



We have an global application, which is already used by customers. Now, we are changing this app to "Private scope". To help customers, we are thinking of providing a migration script, which will copy global application to scoped application. I am able to copy everything including Properties,Tables data. However, I am not able to copy "Password2 property" value alone.



I guess asking customers to copy manually is not appropriate. Is there any alternative solution?


Thank you for the clarification.



As you may have already found out, the gs.setProperty() method is not available in scoped apps. However, you might be able to do this with a Fix Script. I believe those run in the global scope. I'd have to double check. The Fix Script will run when the scoped app is installed (using the publish/install method, not update sets.)



Give it a try and let me know.



Fix Scripts - ServiceNow Wiki


View solution in original post

Hi Chuck,



gs.getProperty() itself returning NULL value. Even it's not able to retrieve a "password2" field.


As I am not able to access "gs.setProperty()", I made a design change. Instead of using properties, I put these properties into a table and started using that table. At the time of migration, I am able to copy all property values of different types. Only password2 value is giving NULL.



gs.getProperty("com.companyname.category.secret')



Meanwhile, I will check whether I can use "Fix scripts".


Hi Chuck,



I am able to implement this via fix script. However, i have already a scheduled job, which is doing remaining almost 99% migration. Is there any way, I can call one from another?   Either call fix script from scheduled job or vice-versa?



This will help customers/users to run only 1 job, either scheduled job or fix script.



Thanks


Rami Reddy