Monday, June 23, 2014

SharePoint 2013: Moving Lists using the Site Content and Structure Tool


The Site Content and Structure tool presents a tree navigational structure to all farm objects.  It's made available, after activating the Publishing feature. Using this tool, the administrator can copy, move, add and delete objects within a farm site collection.  It's also handy if you need to migrate a smaller list from on site to another, within a site collection, since it can do this whilst preserving critical security data, such as the identities of those who made changes to a list item. By "small" I mean around 5000 or less. However, there are a few caveats you might not be aware of when using this tool that can adversely impact the migration in unusual ways. These involve: how to copy entire lists and libraries and preserving ID for each moved or copied item.

Copying Entire Lists and Libraries

To begin with, Site Content and Structure cannot copy or move entire lists and libraries - when selected at that list or library object level.  By this I mean that if you select a site in the left tree view pane, and then select the list or library in the right results pane, the Copy and Move options are not available to you from the Actions dropdown.  On the other hand, you can move the entire list or library, if you go about this by selecting the list or library contents, and then selecting Copy or Move.  Here's how to do this:
  1. Connect to the site collection as farm administrator (eg, spAdmin).
  2. Navigate to the target list of library.
  3. Click the LIST tab, and then click List Settings.
  4. Under Permissions Management group, click Save list as template.
  5. Enter information as desired, but be sure NOT to enable the Include Content option.
  6. Click OK.  This saves the list or library as a template to the site collection's Template Gallery from whence you can create new instances of this list or library anywhere else in the site collection.
  7. From the Settings menu, select Site Settings.
  8. On the Site Settings page, look under Site Administration, and then click Content and structure.
  9. In the left tree view pane, open the tree to the desired list or library, and then click this list or library.
  10. In the right pane, increase the list item count sufficiently to include either all of the list items you want migrate or at least to limit the number of times you need to perform this operation.
  11. From the Actions dropdown, select Copy.  You could select Move, but I like to be on the safe side and only delete a source item if I am absolutely sure it is safe to do so.
  12. Navigate to the next 100, 500 or 1000 and repeat.
Preserving List or Library Item ID

If you use the method above to migrate list or library items, and you need to preserve existing item IDs, you must perform the migration correctly each time, one time and without mistakes.  Let me explain.

Let's say you had 100 items in a list.  You want to migrate these to an archive.  You migrate 10 of these over to your archive list.  You check and observe that these ten items in the archive have the same IDs as their counterparts in the live list.  You then migrate another ten, but then realize, after migrating these that you made a mistake and selected the wrong ten.  You then delete these mistaken ten items from the archive.  At this point, your archive list contains the first ten that you migrated over.  Now, you go back to the source list and migrate the next ten over, this time correctly selecting them.  Once the migration completes, you check the IDs of all of the items in the archive and note a curious finding: of the ten new items that you just now migrated to the archive some have IDs that are incremented by 10 from their original values.  So you delete these and again perform the migration.  Now, some of these newly added ten items have IDs that are incremented by 20 from their original values and some by 10.  Do you see what is happening here?  Once an ID is used in a list or library, that's it: it isn't used again.  The more you try to correct this, the more complex become the ID assignments.

Thus, in using the above method, note that it does get the job done without having to purchase a dedicated list migration tool when migrating small lists.  However, when using it, one has to perform the migration correctly.  If any mistakes are made, it's best to delete the destination list or table, recreate it, and start all over again.



Ricky said...

Hi Al,

We have an internal SharePoint site where the list view threshold is set at 20,000 items for Admins. One of our list has more than 20,000 items divided into folders with each folder not having more than 5000 items. One of our Admins are trying to use "Content and Structure" to move content but the folders in the library have become static and won't let him move content within folders. Is this because we have crossed the list view threshold?


Al said...

Ricky - change the List View Threshold for Auditors and Administrators to something larger than the list size. Then login using a farm administrator account and again try using Content and Structure to migrate.