Move Survey from Portal A to Portal B

2640
6
Jump to solution
02-26-2018 08:03 AM
Cristian_Galindo
Occasional Contributor III

Hello fellows,

I am setting up a continuous delivery process for ArcGIS portal artifacts, currently my objective is to be able to move the content from one portal to another (dev to production), I have checked this document: https://enterprise.arcgis.com/en/portal/latest/administer/linux/example-copy-content.htm

I am able to copy the artifacts from one portal to another, but one of the artifacts is a Survey Form, This artifact  is copied but it is not functional, I am assuming that is because its definition includes a reference to the Feature service. am I correct? how could this reference could be changed with out publishing the Survey again?

thanks for any hint

0 Kudos
1 Solution

Accepted Solutions
MarikaVertzonis
Esri Regular Contributor
6 Replies
by Anonymous User
Not applicable

Hi Cristian,

I assume the portal url of Portal A is different to the portal url of Portal B?

Also, when you copy the feature service and survey form item from Portal A to Portal B using the script, do both of those items get a new itemID? If so this will be the cause of the issue, as the portal url and itemID of the feature service are hardcoded in the form item contents.

Republishing the survey via Connect and ensuring it is pointing to the correct portal url and itemID is the best way to ensure the survey works and is submitting data to the correct feature service.

There may be other ways to create a python script to download the form item, extract it, update the contents of the files in the form item where required, zip it back up, then upload, however would need to explore this idea further to see if it would actually work. It would be similar to the script used to update files in the media folder of a form item: https://community.esri.com/groups/survey123/blog/2017/12/08/an-alternative-way-to-update-the-media-f... .

Regards,

Phil.

0 Kudos
Cristian_Galindo
Occasional Contributor III

Philip thanks for your answer,

regarding your comments:

I assume the portal url of Portal A is different to the portal url of Portal B?

 you are correct

Also, when you copy the feature service and survey form item from Portal A to Portal B using the script, do both of those items get a new itemID?

I think so, I do not check that.

Republishing the survey via Connect and ensuring it is pointing to the correct portal url and itemID is the best way to ensure the survey works and is submitting data to the correct feature service.

So far is the correct way, but from a point of view of DevOps it is not the best way to do it, because there is no way to automate the process.

There may be other ways to create a python script to download the form item, extract it, update the contents of the files in the form item where required, zip it back up, then upload, however would need to explore this idea further to see if it would actually work.

I was trying to understand the code in Connect, but to be honest I am not good at QT code, more over, I download the code, and preparing the environment to make the code compile has take all the morning, and the percentage of progress is under the 10% (Installing QT  )

0 Kudos
by Anonymous User
Not applicable

Hi Cristian,

You do not require AppStudio or QT to modify the the contents of the Form item that is downloaded from AGOL or Portal. AppStudio or QT are used to modify the source code of the application. To just update the itemID and portal URL of the items in the Form item (ie the survey), this can be done using a python script, similar to updating the media folder. The Form item is basically a zip file, so once downloaded from your Portal, it can be extracted, the files updated (excel file, .info file etc), and then uploaded again. This can all be automated if you are proficient with python.

Phil.

0 Kudos
Cristian_Galindo
Occasional Contributor III

Thanks for your answer Phil,

I was trying to dig in the QT code of the application in order to understand how the Feature service and the tables are created, I mean, I was trying to reproduce the publishing procedure of a survey.

If I open the zip file, and make a search and replace to the files, I need to recreate the feature service and the tables prior to the replacement.

Cristian

0 Kudos
MarikaVertzonis
Esri Regular Contributor

Ive recently been told about this tool - it sounds like what you need -

GitHub - Esri/ago-clone-items: Tools used to clone items between ArcGIS Online and ArcGIS Enterprise... 

MarikaVertzonis
Esri Regular Contributor

There is one cavet with this tool - if your original survey used a submission url (eg: because you built it upon an existing feature service) that url will still be in the cloned spreadsheet. That's fine until you want to modify the new survey and want to publish it. Be sure to either delete the submission url or change it to point to the new feature service before republishing the survey.