Select to view content in your preferred language

Via only ArcGIS API for python script, Is there a way to publish/overwrite an ArcGIS Online MMPK file?

1070
2
08-12-2019 03:20 PM
MarietteShin
Regular Contributor

I have manually been publishing an Mobile Map Package (.mmpk) within ArcGIS Pro 2.2 using the "Share Mobile Map" interface. However, I update this same .mmpk every month, and have been trying to figure out how to use ArcGIS API for python to update/publish/overwrite the my mmpk file on ArcGIS Online, but have been unsuccessful.

We do NOT have Portal/Enterprise. We only have ArcGIS Online. Is there a way to do this? If so, would someone provide a sample for this?

Thanks.

0 Kudos
2 Replies
JoshAndreas
Occasional Contributor

I've only used this in Portal, but the API documentation seems to indicate that the same process I use ought to work for AGOL. See my answer on the Portal version of this question:

https://community.esri.com/thread/234003-update-mmpk-on-portal-through-python-api 

You'll obviously need to tweak my 2nd line to connect to AGOL instead of Portal.

Edited to add:

I update the .mmpk itself by using arcpy.management.CreateMobileMapPackage then get it into Portal using the above.

Create Mobile Map Package—Data Management toolbox | ArcGIS Desktop 

Since you're in AGOL, I'm pretty sure the function below could work if you didn't feel like loading both arcpy and arcgis modules:

Share Package—Data Management toolbox | ArcGIS Desktop 

(I couldn't get the above to work in Portal. I think it only works for Portal if you run it within Pro itself.)

0 Kudos
MarietteShin
Regular Contributor

Thank you very much for your reply, Josh.

I will take a look at your script and give it a try.

Best Regards,

Mariette

Mariette Shin

Information Systems Analyst III - GIS

Marin Municipal Water District

220 Nellen Avenue

Corte Madera, CA 94925

t 415-945-1443

mshin@marinwater.org<mailto:mshin@marinwater.org>

Follow us on the Web<http://www.marinwater.org>, Twitter<http://twitter.com/thinkbluemarin>, Facebook<http://facebook.com/marinwater>, Nextdoor<https://bit.ly/mmwd-nextdoor>, and our Blog<http://www.marinwater.org/blog>.

0 Kudos