Introduction
Sometimes, you need to move a document library to another site, such as an archive site. This can be done in several ways:
Save as Template using the Include Content option
Sometimes, you need to move a document library to another site, such as an archive site. This can be done in several ways:
- Save as template using the Include Content option
- Bulk copying using the site collection Content and Structure tool
- Bulk copying via Windows Explorer
- Moving using stsadm
- Moving using PowerShell
- Third party tools
Save as Template using the Include Content option
- Pros
- Easy to use.
- Easy access to template after you're done - it's stored in the site collection template gallery.
- effectively creates a backup copy.
- Does not require advanced knowledge of PowerShell.
- Can be done entirely through the web interface.
- Preserves all public views.
- Cons
- Limited to maximum template size set by administrator.
- Cannot specify security or version settings.
- Does not preserve version history.
- Requires at least Design level permission.
- No log file generated.
- Procedure
- Login to the site using an account that has at least Designer level permissions.
- Navigate to the target site document library.
- Click the LIBRARY tab to display the Library ribbon.
- In the Settings group, click the Library Settings button.
- In the Permissions Management list group of links, click Save document library as template.
- Enter desired template and file names, check the Include Content checkbox; and then click OK. The document library is then stored in the site collection's List Template gallery.
If the list is larger than about 50 MB, you will experience an error. To resolve this error, increase the maximum list template size. See the references in this section for details.
- Click the Settings gear icon, and then click Site Settings.
- In the Web Designer Galleries group, look for List templates.
If you don't see it listed here, be sure you are at the site collection level. You can check this by looking in the Site Collection Administration group: if you can see the link, Go to top level site settings, click it.
- Click the link, List templates.
- Verify that your document library template is listed. Click the Edit button to modify the template title and filename.
- Now, navigate to the site where you want the document library moved to.
This site must exist in the same site collection as the source document library. If it isn't you can still move it, but you will need to download the template WSP file from the source site collection list template gallery and then upload it to the destination site collection list template gallery. The list template gallery is just a document library, so, you know how to do this.
- Click the Settings gear icon, and then click Site contents.
- Click the add an app icon.
- Follow the usual steps for adding a new app (ie, document library), only this time choosing the document library template you created. This creates the document library along with all its content.
Note: the document properties Created by and Modified by will be changed for those users who have since left your organization and no longer have Active Directory accounts. SharePoint will change these to the user account that performed the Save as Template operation. If you need to preserve such information, you must either copy it to new, custom properties or use a third party tool
- References
- SharePoint 2010: The list is too large to save as a template
- What is the Size Limit for Saving a Document Library as a Template (SharePoint 2010)
- How to use Powershell to set Max template document size
- Increase Maximum size of Site, List Templates in SharePoint
- Copy or move a library by using a library template
- Save, download, and upload a SharePoint 2013 site as a template
- SPWebService.MaxTemplateDocumentSize property
- Software boundaries and limits for SharePoint 2013
- Notes
- Default maximum document size template: this would seem to be 50MB, per this Microsoft article: Save, download, and upload a SharePoint 2013 site as a template. However, in actual practice, I have found it to be 52.428800 MB. This value was obtained by executing
$webservice = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
in an elevated SharePoint PowerShell Management shell on a newly deployed SharePoint 2013 farm for which this setting had not yet been modified.
$webservice.MaxTemplateDocumentSize
- Default maximum document size template: this would seem to be 50MB, per this Microsoft article: Save, download, and upload a SharePoint 2013 site as a template. However, in actual practice, I have found it to be 52.428800 MB. This value was obtained by executing
- Pros
- Does not require knowledge of PowerShell.
- Can be done entirely through the web interface.
- Existing security settings are migrated.
- Cons
- Cannot specify security or version settings.
- Version history migrated inconsistently (some are, some are not).
- Significant complications if document library employs folders: can only be used to copy subfolder by subfolder.
- Only works to copy documents from one location to another within the same site collection - does not work for copying documents across site collections.
- File size limited to whatever is set for the farm.
- Procedure
- Login to the source site using an account that has at least Designer level permissions.
- Navigate to the target site document library.
- Click the LIBRARY tab to display the Library ribbon.
- In the Settings group, click the Library Settings button.
- In the Permissions Management list group of links, click Save document library as template.
- Enter desired template and file names, and then click OK. The document library is then stored in the site collection's List Template gallery.
Do not check the Include Content option.
- Click the Settings gear icon, and then click Site Settings.
- the Web Designer Galleries group, look for List templates.
If you don't see it listed here, be sure you are at the site collection level. You can check this by looking in the Site Collection Administration group: if you can see the link, Go to top level site settings, click it.
- Click the link, List templates.
- Verify that your document library template is listed. Click the Edit button to modify the template title and filename.
- Now, navigate to the site where you want the document library moved to.
Note: This site must exist in the same site collection as the source document library. If it isn't you can still move it, but you will need to download the template WSP file from the source site collection list template gallery and then upload it to the destination site collection list template gallery. The list template gallery is just a document library, so, you know how to do this.
- Click the Settings gear icon, and then click Site contents.
- Click the add an app icon.
- Follow the usual steps for adding a new app (ie, document library), only this time choosing the document library template you created. This creates an empty document library that has the same configuration as the source library. You need source and destination libraries in order to use the Content and Structure tool, because this tool only copies content from one location to another.
- Click the Settings gear icon, and then click Site Settings.
- In the Site Administration group, click Content and structure.
- Using the tree navigation at left, select the document library that you want to move. Once you select it, its contents will appear in the Results panel.
- From the View dropdown, select a view that presents a simple list (no folders) of all of the documents. By default, 100 items will be shown.
Note: if your document library employs folders, for some reason, the Site Content and Structure tool will show these even if you select a previously configured view that specifically excludes them. For example, if your document library employs folders, you can create a simple list view that presents the documents as a single list without folders, and this view works just fine when you are looking at the contents of the library while connected to the document library's page. On the other hand, the library folders will appear in the left navigation as subitems under the document library.
- Check the documents that you want to copy - don't use the Move option or you otherwise will not be able to verify that all of them were copied over.
Note: for document libraries employing folders, you will only be able to copy items over subfolder by subfolder. For example, if two documents lie buried three subfolders deep, it will not work to check these, select another subfolder, checking those, and then selecting Copy from the Actions menu: only the currently visible and checked items will be copied.
- Once you have select afrom the Actions menu, select Copy. A popup will appear presenting the usual site collection tree structure.
- Expand the tree to the empty document library that you created back in steps 14, and then click OK. The popup will close, and you will see progress information appearing temporarily. Once done, select the new library and you will see listed the documents that you copied over.
- Repeat this process for all the documents that you want to copy.
- At the end of this process, use simple column counts to verify that all documents have been copied over.
- Once the copied items have been verified, delete the source list or library.
- References
- How to Use the Site Content and Structure Manager in SharePoint 2013
- SharePoint 2013: Moving Lists using the Site Content and Structure Tool
- Software boundaries and limits for SharePoint 2013
- Notes
- I found moving lists this way to be advantageous when needing to preserve list item IDs.
- Pros
- Simple to use.
- User permissions in Windows Explorer are consistent with user permissions to document library.
- Does not require elevated permissions.
- Cons
- All version history is lost.
- All security configuration is lost.
- Metadata (column) properties may be lost or misinterpreted.
- Must have Contribute (write) permission to destination library.
- No log file generated.
- Procedure
- Navigate to the source document library.
- Select the LIBRARY tab.
- In the Connect & Export group, click the Open with Explorer button. Leave this open.
The open with Explorer functionality requires 32-bit ActiveX. This button will not be enabled if using 64-bit Internet Explorer, Chrome or other browsers not featuring native 32-bit ActiveX support. Add-ons are available for some of these other browsers, such as Chrome, that will emulate 32-bit ActiveX.
- Navigate to the destination document library.
- Select the LIBRARY tab.
- In the Connect & Export group, click the Open with Explorer button. Leave this open.
- Copy documents from the source folder to the destination folder.
- Once the copied items have been verified, delete the source list or library.
You must delete the library through the library settings page. You cannot delete it through the Windows Explorer window.
- References
- Copy or move library files by using Open with Explorer
- How to use the "Open with Explorer" command and how to troubleshoot issues with this option in SharePoint Online
- Plan browser support in SharePoint 2013
- IE Tab Extension for Chrome
- Notes
- To determine whether Internet Explorer is 32 or 64 bit, select About Internet Explorer from the Help menu. If the browser is 64-bit, the Version will indicate this.
- Pros
- Simpler permissions to use.
- Finer control over export.
- Preserves security and most version history.
- Generates log file for export and import operations.
- Cons
- Must be member of local administrator's group.
- Deprecated.
- Procedure
- Open a command shell on a SharePoint farm server.
- Execute the following command:
stsadm -o export -url "<source library url>" -filename " "<save file path and name>" -includeusersecurity -versions 4.
- Source Library URL is URL seen in the address bar when viewing the library. So, if the library is in site Marketing and is called Documents, the URL you would enter would be: http:/Contoso/Marketing/Documents. Note that you don't include the extra part that points to the particular view, such as "Forms/Allitems.aspx."
- Save File Path and Name is local or network location and file name.
- In the same browser, execute the following command:
stsadm -o import -url "<destination library url>" -filename "<file path and name>"
- Delete the source library.
- References
- Index for Stsadm operations and properties (Office SharePoint Server)
- Some key differences between stsadm export and backup operations
- Stsadm to Windows PowerShell mapping in SharePoint 2013
- Complete reference of all STSADM operations (with parameters) in MOSS 2007 SP1
- Exporting and Importing site, library or list using STSADM SharePoint Administration tool
- Export: Stsadm operation (Office SharePoint Server)
- Notes
- Pros
- Can be scheduled as a task
- Finer control over export process via parameters
- Generates log file
- Cons
- Requires advanced scripting knowledge.
- Must be member of SharePoint_Shell_Access role.
- Procedure
- Login to any SharePoint server using an Administrator account.
- Launch an elevated instance of the SharePoint Management Shell.
- Execute the following:
Export-SPWeb -Identity "<sourceurl>" -ItemURL "<itemUrl>" -Path "<path>" -IncludeUserSecurity -IncludeVersions "All" -CompressionSize 1000 -Force - <sourceurl>: this is the url to the site containing the document library. If the site containing the library was Marketing, you might enter something like this: http:/SharePointFarm.Com/Marketing/. That's it. Nothing else. Note the concluding forward slash. I left out one of the begining forward slashes so that it wouldn't be rendered in this page as a hyperlink.
- <itemUrl>: this is the name of document library and the extra portion containing the view. For example, if the document library was called Documents, you might enter something like this: Documents/Forms/AllItems.aspx. Note that it does not start with a forward slash.
- -CompressionSize 1000 -Force: these last parameters ensure that the export generates a single file. Note that compression size is in MB.
- After finishing the export, import the file to its new location by executing the following:
Import-SPWeb -Identity "<destinationurl>" -Path "<path>", where - <destinationurl> is the URL to the site to which you want to import the library. For example, if your site was marketing, it would be htp://contoso.com/marketing/.
- <path> is the path and file name of the list to be imported. For example, if the file was stored in the Imports folder off the root, it would be: C:\Imports\MyLibrary.cmp.
- References
- Import-SPWeb
- Export-SPWeb
- Export sites, lists, or document libraries in SharePoint 2013
- Import a list or document library in SharePoint 2013
- Cannot find an SPWeb object with Id or Url
- Get-SPWeb : Cannot find an SPWeb object with Id or Url
- Software boundaries and limits for SharePoint 2013
- SharePoint 2013: To export a site, list, or document library
- Export/Import-SPSIte :- What is the max size limit that can be moved using this command??
- Use Windows PowerShell to administer SharePoint 2013
- Notes
- Pros
- Finer control over export process via parameters
- Can be performed online using simple web interface
- Doesn't require advanced knowledge
- Generates a log file.
- Cons
- Requires user to be a member of the farm administrator's group
- Can only be used to export list - cannot be used to import a list.
- No control over other parameters, such as compression or multiple files
- Procedure
- Launch Central Administration
- Go: Backup and Restore > Granular Backup > Export a site or list
- Configure as appropriate
- Click the Start Export button.
If a local URL is entered (eg, D:\test.cmp), the file will be saved to the farm application server that is hosting Central Administration.
- To then import this, you must use PowerShell or stsadm.
- References
- Export sites, lists, or document libraries in SharePoint 2013
- Software boundaries and limits for SharePoint 2013
- SharePoint 2013: To export a site, list, or document library
- Notes
- Pros
- Can preserve all version history and security information
- Don't require advanced technical knowledge
- Cons
- Legal and regulatory Import/Export considerations (if vendor is foreign to your country)
- Costs
- Listing
- SharePoint List Transfer
- CopyMove for SharePoint 2013
- Content Matrix
- ShareGate
- Kroll Ontrack PowerControls
- Notes
No comments:
Post a Comment