August 17, 2017

How to Transfer Web Apps Between Users or Different Versions in Web AppBuilder


(Source: Esri)

 

We all love Web AppBuilder.


Web AppBuilder makes life so much easier when creating and deploying Web Apps with out-of-the-box and custom widgets. One specific thing I’ve noticed is Web AppBuilder allows you to import local apps or your own portal account, but it doesn’t allow the transfer of apps between different accounts. Also, if you are transferring one or two apps, you could download a zip, and share it with your colleagues. But, what happens if you are transferring, say, 10 apps or 50?


So, let’s get down to business: How to Transfer Web Apps Between Users or Different Versions in Web AppBuilder.


The portal request for the list of apps for a user looks something like this: 

https://<server.fqdn.com>:3344/webappbuilder/rest/apps/list?username=<portaluser>&portalUrl=<FQDN-URL>

You can grab a list of apps for any user by changing the username parameter in this URL above. Magic!!! 


Okay, let’s not get carried away - this is still step one. To find the actual file where changes could be made, I dug around the files, and it hit me that the URL matches a folder structure on the Web AppBuilder. So, the JavaScript files on the server approximate much of what Portal uses for various content management tasks. 

Further analysis uncovered the exact path for the file which contains the list: 

C:\<path>\arcgis-web-appbuilder-2.x\WebAppBuilderForArcGIS\server\db\apps
This file has no extension but can be opened with any JSON text viewing application. 

Below is an example entry:



Once we understood this is the source, all you have to do is replace the “creator” and “modified” JSON items with the new username who will be the new owner of the app, and voilà! After you find and replace the username, launch the startup.bat and relaunch the Web AppBuilder browser. Voilà again!


Now, let’s say you are having to do a fresh install or move to the latest version of the Web AppBuilder.


Good news - you can copy your apps to the apps folder:

C:\<path>\arcgis-web-appbuilder-2.x\WebAppBuilderForArcGIS\server\apps

Then copy corresponding and relevant entries to the app file we discussed earlier: ‪

C:\<path>\arcgis-web-appbuilder-2.x\WebAppBuilderForArcGIS\server\db\apps. 

This will get the apps to show up correctly in the Web AppBuilder main page. Ain’t this great! (Texan for voilà!)

Make sure to stop and start the node.js when you make any changes, and keep tabs on which apps you are copying and the location of the corresponding text.


We are happy to help.


As always, if you run into any trouble or have questions and want to learn more about Web AppBuilder, reach out to the LOGIC team Info[at]logicsolutionsgroup.com! 


No comments:

Post a Comment