Wednesday, 5 December 2007

Introducing the SharePoint Content Deployment Wizard

Regular readers might have spotted I've been slightly quieter than usual over the past few weeks - actually I've not been slacking, but working on a tool which you might find useful from time to time. As I've discussed in numerous posts, deployment of SharePoint artifacts is something that's perhaps more complex than it should be, and the standard tools provided don't always simplify this picture. Personally, over my past few MOSS projects, there have been several times when I've thought:

  • I just need to move this document library from A to B
  • I just need to move these selected files (e.g. master page, page layouts, CSS etc.) from A to B
  • I just need to move this web from A to B
  • I just need to move this site collection from A to B
  • I just need to move these 20 list items from A to B

If only there was an easy way! CMS 2002 users may remember the SDO export mechanism which allowed you to use a treeview to select exactly which content you wished to move, but unfortunately there's no similar tool for MOSS. Sure, we have Content Deployment and STSADM export etc., but the lowest level of granularity is a web, and if you don't want to overwrite the whole thing neither option can be used. The only other option is to write code which uses the Content Migration API. This is fine for projects which have the appropriate development skills and time, but otherwise things can be tricky.

Enter the SharePoint Content Deployment Wizard.

The tool provides a wizard-like approach to deploying content between SharePoint sites. The selected content is exported using the Content Migration API (PRIME), giving a .cmp file (Content Migration Package) which can be copied to other servers.

Since pictures are often more useful than words, let's look at using the tool. Click to enlarge any of the images below:

EXPORTING CONTENT

Welcome screen (click any image to enlarge):


Select action (import or export) and provide site URL:

 

For export, use the treeview to select which content you wish to deploy. On container objects such as webs, there are options about whether descendent objects should be included:

 

Select options around security, dependencies, versions and name of the export file:
 
 
 
The details are shown back for confirmation, and when 'Finish' is clicked the export will begin:
 
 
 
IMPORTING CONTENT
 

Browse to the .cmp file we exported in the previous steps, and select options around security, versions and, importantly for some scenarios, whether object IDs should be retained:
 
 

The details are shown back for confirmation, and when 'Finish' is clicked the import will begin:
 
 
 

And that's the gist of it. This is the first beta of the tool and I'm sure there will be issues. Regardless, when using any tool which makes this kind of change to your data you should always take a backup before performing the import. Depending on what you're doing, it could be difficult to revert back to the previous state otherwise.

Some other notes:

  • the tool must be installed locally on the server which hosts the site
  • not all features of the Content Migration API are supported by the tool
  • the next beta (mid-December) will properly support large sites - currently the site bind operation can be slow for large sites since the treeview is built in one operation
  • it must be run under an account which has the appropriate permissions to the SharePoint site - use the Windows 'Run as..' feature to do this if necessary (shown below in the image below- right-click on the .exe and select 'Run as..')


 
In the next post, I'll cover details on different usages of the tool and the effect of different options. The tool also supports reparenting (e.g. importing a web or list to a different parent on the target) and I'll talk about this.

You can download the tool now from www.codeplex.com/SPDeploymentWizard. All feedback (particularly bug reports) welcome, either post here or on the Codeplex site.

222 comments:

«Oldest   ‹Older   201 – 222 of 222
Chris O'Brien said...

@Anonymous,

Good news on a couple of these points:

- You can use this tool to go from MOSS to WSS (2007 and 2010)
- When you move content using this tool (or indeed any other based on SharePoint's Content Deployment API), content types will automatically be deployed to the target. (However, there are some caveats with this - they only get created as *list* content types, not *site* content types too. Also there is no way to deploy content types only - you have to pick up some content which depends on them).
- The tool can be used to import into a site with a different name. Just pick up the list/library only rather than the entire site.

HTH,

Chris.

Louise van der bijl said...

Thank you so much for this! It saved me from yet another month of fighting with powershell and not being able to get it right. I have spent 3 days now on your blog and have learnt more from you alone than from a month of google.6lou

Anonymous said...

Hi Chris, great tool. I was wondering if I would be able to use this tool to export lists from the Sharepoint 2010 beta to Sharepoint Foundation? Thanks in advance.

Chris O'Brien said...

@Anonymous,

No I'm afraid not - as I've mentioned earlier in these comments, Microsoft intentionally block Content Deployment tools from beta to RTM, since the underlying database structures are different.

HTH,

Chris.

Anonymous said...

Is there any way that I can customize the User Interface for this tool..??

Chris O'Brien said...

@Anonymous,

Sure - all the source code is published at the Codeplex link, so you can make whatever changes you like.

HTH,

Chris.

Kurt said...

When I use the wizard to move documents in a document library from one site to another in the same site collection will the metadata stay intact? I'm speaking about read-only metadata like created by, create date, modified by, modified date.

The following methods modify those columns: Content and Structures (Site Manager) move, SharePoint Designer cut/paste between sites, Ziegler's Bulk Action Move utility, doc library Window Explorer view using cut/paste between folders, site templates.

I'm trying to do this without resorting to the time&effort to creating a SharePoint development environment and rolling my own.

Chris O'Brien said...

@Kurt,

Yes, metadata is preserved using this tool.

Thanks,

Chris.

Anonymous said...

Awesome pretty cool!!!... i just wanted to move a image library between sites preserving metadata and work perfect!!

shobs said...

I get the error when importing wss 3.0 content to SP 2010.

FatalError: The version of the package 12.0.10.0 is different from the current version this program supports, 14.0.0.0.
[3/16/2011 9:59:15 PM] Debug: at Microsoft.SharePoint.Deployment.SPDeploymentSchemaVersion.Validate(SPSite site)
at Microsoft.SharePoint.Deployment.SPImport.Run()

Chris O'Brien said...

@Shobs,

Yes I'm afraid that's the case - what the error is telling you is that Microsoft intentionally block you from using Content Deployment to move content between versions of SharePoint. This is basically because there are so many backend changes between (e.g.) SharePoint 2007 and 2010.

You'll need to use one of the migration strategies (e.g. database attach) to move your content.

HTH,

Chris.

Falgun Patel said...

Hi Chris,

This is a great piece of information for even beginners like me. We are having one requirement under which we need to replicate test/dev env from prod environment. We need to also migrate couple of .wsp files which are currently installed upon production server. Can we do it with spContentDeploymentWizard?

Chris O'Brien said...

@Falgun,

The Content Deployment Wizard does not deal with WSPs - that's a separate step in your deployment process. My tool deals with SharePoint content (e.g. sites, lists/libraries), and always requires any supporting artifacts (e.g. those deployed in a WSP) to be present in the target environment for it to work.

HTH,

Chris.

Anonymous said...

Hi Chris,

Is this tool good for Sharepoint 2010?
If yes,Why do I get log file full of errors ,like :"File reader couldn't understand line ..."
and can't import file?

Thanks ahead!
Nicki

Chris O'Brien said...

@Nicki,

I haven't heard of this issue, and have successfully used the tool against SharePoint 2010. Can you give any more detail on what you're doing?

Thanks,

C.

Anonymous said...

Awesome tool. Now we just need a real-time O'Brien replication tool :D

Unknown said...

Just downloaded the latest beta version. During import, I don't have a way to specify multiple files. Please advise.

Chris O'Brien said...

@Daisy,

On the import screen, select the "Import from multiple files" option. In the textbox, specify the "base filename" i.e. MyFile.cmp rather than MyFile001.cmp or MyFile002.cmp etc.

HTH,

Chris.

Unknown said...

My initial export and import were successful for a large content site. However, the subsequent content deployment job using Central Administration still doing full export. Is there a way to have it recognize that the content has been fully exported, and it should do an incremental instead?

rajesh said...

Hi Chris

I see that the tool doesn't support deploying the navigation changes. I have a requirement to push navigation changes from a publishing site in one farm to anoher site. I'm not using content deployment and hence a need to write custom script to automate this. What I'm looking for is a way to push down the incremental changes to navigation.

I think SharePoint content deployment uses change log to push down the changes. I've looked at the change log API - https://msdn.microsoft.com/en-us/library/office/bb447511(v=office.14).aspx. I've tried to see what the change log contains and if it contains specific navigation changes, sample code below

SPChangeQuery query = new SPChangeQuery(false,false);
query.Site = true;
query.Web = true;
query.Navigation = true;
SPChangeCollection changes = site.GetChanges(query);

I'm unable to get details of the navigation changes from SPChange object. The SPChangeWeb doesn't give any details of navigation changes. I was hoping to get details of new navigation items that were added, any updates made and any deletions happened. Would you know how content deployment handles this? Is there a way to get navigation changes from change log?

Thanks

Chris O'Brien said...

@Rajesh,

Hmm. I think navigation changes may have been added to the Content Deployment API in the SP2013 release - but I'm not sure why your sample code would not return them.

What happens if you don't filter at all on the change type? Do you see any navigation changes in the results then?

Thanks,

COB.

Unknown said...

Would be great to see this developed more so it works on SP 2013 or SP Online.

Thanks

«Oldest ‹Older   201 – 222 of 222   Newer› Newest»