|
26 | 26 | }, |
27 | 27 | { |
28 | 28 | "cell_type": "code", |
29 | | - "execution_count": 2, |
| 29 | + "execution_count": 4, |
30 | 30 | "metadata": {}, |
31 | 31 | "outputs": [], |
32 | 32 | "source": [ |
|
46 | 46 | }, |
47 | 47 | { |
48 | 48 | "cell_type": "code", |
49 | | - "execution_count": 4, |
| 49 | + "execution_count": 7, |
50 | 50 | "metadata": {}, |
51 | 51 | "outputs": [], |
52 | 52 | "source": [ |
|
67 | 67 | }, |
68 | 68 | { |
69 | 69 | "cell_type": "code", |
70 | | - "execution_count": 5, |
| 70 | + "execution_count": 3, |
71 | 71 | "metadata": {}, |
72 | 72 | "outputs": [ |
73 | 73 | { |
|
79 | 79 | " <Group title:\"Vector Basemaps (for Export)\" owner:esri>]" |
80 | 80 | ] |
81 | 81 | }, |
82 | | - "execution_count": 5, |
| 82 | + "execution_count": 3, |
83 | 83 | "metadata": {}, |
84 | 84 | "output_type": "execute_result" |
85 | 85 | } |
|
91 | 91 | }, |
92 | 92 | { |
93 | 93 | "cell_type": "code", |
94 | | - "execution_count": 6, |
| 94 | + "execution_count": 4, |
95 | 95 | "metadata": {}, |
96 | 96 | "outputs": [ |
97 | 97 | { |
|
121 | 121 | "<Group title:\"Vector Basemaps\" owner:esri>" |
122 | 122 | ] |
123 | 123 | }, |
124 | | - "execution_count": 6, |
| 124 | + "execution_count": 4, |
125 | 125 | "metadata": {}, |
126 | 126 | "output_type": "execute_result" |
127 | 127 | } |
|
140 | 140 | }, |
141 | 141 | { |
142 | 142 | "cell_type": "code", |
143 | | - "execution_count": 9, |
| 143 | + "execution_count": 5, |
144 | 144 | "metadata": {}, |
145 | 145 | "outputs": [ |
146 | 146 | { |
|
149 | 149 | "[<Item title:\"Colored Pencil Map\" type:Web Map owner:esri>]" |
150 | 150 | ] |
151 | 151 | }, |
152 | | - "execution_count": 9, |
| 152 | + "execution_count": 5, |
153 | 153 | "metadata": {}, |
154 | 154 | "output_type": "execute_result" |
155 | 155 | } |
|
273 | 273 | " break\n" |
274 | 274 | ] |
275 | 275 | }, |
| 276 | + { |
| 277 | + "cell_type": "markdown", |
| 278 | + "metadata": {}, |
| 279 | + "source": [ |
| 280 | + "**Note:** The [GroupManager.clone()](https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.toc.html#arcgis.gis.GroupManager.clone) doesn't clone the group’s items, it only recreates groups from site A to site B. " |
| 281 | + ] |
| 282 | + }, |
276 | 283 | { |
277 | 284 | "cell_type": "markdown", |
278 | 285 | "metadata": {}, |
|
317 | 324 | "#cloning all items that were not present on the portal before\n", |
318 | 325 | "for item in items_to_be_cloned: \n", |
319 | 326 | " try:\n", |
| 327 | + " thumbnail_file = item.download_thumbnail()\n", |
320 | 328 | " target_item_properties = ItemProperties(title=item.title,\n", |
321 | 329 | " tags=item.tags,\n", |
322 | 330 | " text=item.get_data(try_json=True),\n", |
323 | 331 | " item_type=item.type,\n", |
324 | 332 | " snippet=item.snippet,\n", |
325 | | - " description=item.description) \n", |
| 333 | + " description=item.description,\n", |
| 334 | + " thumbnail=thumbnail_file) \n", |
326 | 335 | " #create an item\n", |
327 | 336 | " root_folder = target.content.folders.get()\n", |
328 | 337 | " job = root_folder.add(item_properties=target_item_properties, item_id=item.id)\n", |
|
339 | 348 | " print('Item {} could not be created in the target portal'.format(item.title))\n", |
340 | 349 | " print(e)" |
341 | 350 | ] |
| 351 | + }, |
| 352 | + { |
| 353 | + "cell_type": "markdown", |
| 354 | + "metadata": {}, |
| 355 | + "source": [ |
| 356 | + "Please see [GroupMigrationManager](https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.toc.html#groupmigrationmanager) for offline exporting of group items" |
| 357 | + ] |
342 | 358 | } |
343 | 359 | ], |
344 | 360 | "metadata": { |
|
0 commit comments