Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloning survey items from on-prem Portal to Arcgis.com #2

Closed
derekwmiller opened this issue May 24, 2021 · 12 comments
Closed

Cloning survey items from on-prem Portal to Arcgis.com #2

derekwmiller opened this issue May 24, 2021 · 12 comments

Comments

@derekwmiller
Copy link

Is cloning surveys from on-prem portal to Arcgis.com supported?

I can successfully clone the survey folder and all items from portal - arcgis.com, but survey123 does not recognize the survey. Survey123 errors with 'The survey does not exist or is not accessible.'

@Zachary-Sutherby
Copy link
Collaborator

Hello @derekwmiller, cloning from an internal Enterprise organization to ArcGIS Online is supported. Are you using a registered feature service with your survey (is the service pointing to an enterprise geodatabase)? On the item details page of the Form item created in ArcGIS Online there will be a Layers section halfway down the page. In that Layers section does it have the link to the hosted feature layer in your ArcGIS Online organization?

@Zachary-Sutherby
Copy link
Collaborator

Troubleshooting sample script: clone_troubleshooting.zip

@derekwmiller
Copy link
Author

Hi @Zachary-Sutherby. I'm not using a registered feature service. It's a hosted feature service. Post clone, there is a layer section with a link to the feature service but the service URL requests a token (which is odd, to say the least). Note that I tested and successfully cloned feature services when I first encountered the issue with the surveys.

@Zachary-Sutherby
Copy link
Collaborator

Hello @derekwmiller,

I think I've narrowed down the issue and have added a fix in the notebook that's working on my end.

Here is a zip file with the updated notebook containing the fix. clone_surveys_from_one_organization_to_another.zip

If you test on your end do you see the same error message?

@derekwmiller
Copy link
Author

thanks @Zachary-Sutherby. I'll test and report back

@derekwmiller
Copy link
Author

@Zachary-Sutherby I can't find your fix in that new .ipynb. The actionable cloning action, item gathering from source, etc. looks to be the same as in the repo. What am I missing?

@derekwmiller
Copy link
Author

@Zachary-Sutherby also, just to be clear, there is no data in the survey being cloned. I did notice you're querying the cloned feature services and returning feature counts

@derekwmiller
Copy link
Author

@Zachary-Sutherby same error. I honestly didn't see any functional difference between the ipynb you shared and the code that I had been using that produced the error.

I put together a quick test based off your new notebook (attached) and reproduced the error. Don't be shy pointing out my user error if you one.
share.zip

@Zachary-Sutherby
Copy link
Collaborator

Hello @derekwmiller when I was testing on my end I was seeing that the name of the survey Form item in the back end configuration JSON was different between ArcGIS Enterprise and ArcGIS Online. What I had done in the notebook above was add a couple lines of code that downloaded the survey form item after cloning and made sure the name and file extension of the form item was correct. I then took that downloaded form item and updated the cloned item with the correct file name which worked on my end.

In your scenario I think the link between the survey form item and the feature service it's supposed to be pointing to has somehow been broken. Below I have attached a notebook that will check if that link has been broken. If the link is broken the notebook fixes the link and then does the workflow that the previous notebook does in order to ensure the back end JSON is updated correctly.

add_survey_relationship.zip

As for bringing over the data the notebook discusses the clone_items() method has an optional copy_data argument. By default this is set to True which will copy over the data, otherwise if you don't want the data you can set that argument to false. In my testing I was testing with surveys that contained no data.

@derekwmiller
Copy link
Author

Got it. I had dismissed that section following the clone command thinking "Well I don't need to download the thing". I'll give this a shot @Zachary-Sutherby and let you know. Thanks for all your effort to this point.

@derekwmiller
Copy link
Author

Hi @Zachary-Sutherby
The link between the survey form item and the feature service was not broken.
The download >> update workflow has resolved the issue. Apologies for missing that bit yesterday.

SO -- this is working, currently. Thank you very much.

Couple of questions for you:

  1. Is this going to be logged as a bug and fixed as appropriate? Or, is this download >> update workflow going to be necessary for the foreseeable?
  2. Is the configuration JSON in which you noticed the discrepancy between names something that is exposed via the Python API or otherwise discoverable to users? Or Esri eyes only?

Zachary-Sutherby added a commit that referenced this issue Jul 23, 2021
Updates to clone & update_attachment_keywords notebooks. Resolves issue #2.
@Zachary-Sutherby
Copy link
Collaborator

This issue has been logged as BUG-000141004 and a workaround has been added to the notebook that downloads the survey from the target organization and then immediately updates it using the zip file downloaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants