Moving files with metadata and permissions to another library.

Business case:
We have a document library with files. These files all have specific files level permission. A user can only see files (s)he is allowed to see, and the permission level changes during a workflow. When the document get the status finished, a workflow will remove the contribute right for the contributors and set a read permission for these users. There are also about 30 metadata columns. Some of these columns are just status fields used in a workflow, other ones (about 22) are actual properties of this document.
The library is used to collaborate on files that have a limited time span. When the documents are finished and the responsible people have approved them, they need to be move to a archive.

There are 2 easy ways to do this. (I only discuss solutions without having access to a console on the server to execute STSADM command, nor use solutions that required Visual Studio). Besides these 2 options, you could also execute an STSADM –export of write custom code.

  1. Create a template from your library with content
  2. Create a template from your library without content and move the content using explorer view.

Method one has some restrictions and side-effects. First, the content of the library cannot be more than 10 MB. This limit is in most cases very restrictive, and therefore not the best solution. Also, you can do this only once, since every year the content will change, and you might not want the have a document library template in your template gallery for every year.
You can change the maximum value (10 MB limit) via stsadm -o setproperty -propertyname max-template-document-size –propertyvalue xxxxxx” (xxx being the size in bytes). But hen again, (power)users don’t have acess to the console, so I don’t consider this an option.
We would also have an issue with the item level security since item level security is not maintained in a template.

The second solution is in my opinion a better, more flexible and stable solution.

  1. Create a template from your library using this procedure:

Settings > Document library Settings > Save document library as template
Under the Permissions and Management > Save document library as template

Fill in File name, a Template name and a description for your template, and don’t select Include content. The Template name is the name that will appear when your want to create a document library.

That’s all for the creation of a document library template. This template will now be available when you create a new library or list and appears in the List Template Gallery at http://mySharePointSiteURL/_catalogs/lt/Forms/AllItems.aspx

  1. Create a library based on the new template

The next step is to create a new library based on the template we you created in step 1

In the Quick Launch, click on View All Site Content (or click on Site Actions/View all Site content). This will direct you to the /_layouts/viewlsts.aspx page and shows and overview of all Libraries and lists in your site.

Click create and select the templatename (the one you created in step 1).
Fill in the Name and description and other information.
Once this library is created, validate that all columns exist. (via Document Library settings)

Open the newly created library in Windows Explorer View and open the document library with the source in Explorer view

Then select the documents that you want to move, (using Shift or CTRL and click the documents) and drag them to the destination library.

That’s it.

About Patrick Sledz

Patrick works as a consultant. He assists organizations to deliver SharePoint business value and create the awareness in these organizations that only a strong technical team is not sufficient to deliver this added value.
Tagged , . Bookmark the permalink.