I have used the "Clone Portal users, groups and content" example as a starting point for migrating content from one portal to another. As per the example, I start with users, then groups, and then items. Most items (layers, folders etc.) are copied fine, but there is a number of webmaps that throw an error: Invalid JSON in 'text' parameter.
Inspecting the 'copy_item' method a bit more closely I noticed that the webmaps that fail all seem to have in common that some of their popups contain HTML elements, e.g. "description": "<div style=\"text-align: center;\"><b>{GS_NAME}</b><br... , whereas none of the webmaps that were successfully copied do.
When I run a string downloaded from the source portal using item.get_data(False) through JSLint it passes, but when I then attach this to the target item's text property and post to the target portal, I get the above error. Has anybody come across this and was able to come up with a fix? Trevor Hart and Fraser Hand, I've been told you might be able to help with this?