Monday, 17 December 2007

Using the SharePoint Content Deployment Wizard

So if you've read the earlier posts about the tool (Introducing the SharePoint Content Deployment Wizard and When to use the SharePoint Content Deployment Wizard) and figure this is a useful tool, let's go onto the next level of detail. Generally speaking the Content Deployment Wizard 'just works', but if you want to know more about the different options, read on. This post contains reference information and a guide to some deployment scenarios at the end.

Firstly, let's remind ourselves of some of the fundamental things to remember when moving content using the Content Migration API (the underlying SharePoint API used by the tool):

  • dependencies of selected content (e.g. referenced CSS files, master pages) can be evaluated - in the tool they are automatically included in the export - check 'Exclude dependencies of selected objects' to disable this
  • all required content types, columns etc. are automatically included in the export
  • in contrast to STSADM export, it is possible to retain GUIDs during deployment (where objects are not being reparented) - check 'Retain object IDs and locations' to enable this
  • no filesystem files (assemblies, SharePoint Solutions/Features etc.) are deployed - these must already be present on the target for the import to succeed)
  • the following content does not get captured by the Content Migration API - alerts, audit trail, change log history, recycle-bin items, workflow tasks/state

In particular it's the 2nd and 3rd points which make the API (and the Wizard) a good way to deploy content in SharePoint.

What can be deployed?

The Content Deployment Wizard allows any content to be selected for export - site collections, webs, lists/document libraries, folders, right down to individual list items and files. Objects in the treeview can be added to the export by right-clicking them, which for a web, brings up a menu shown below:



These are explained:-

  • 'include all descendents' - exports the container and anything beneath it
  • 'exclude descendents' - exports the container only
  • on webs only, the 'include content descendents' option is shown - this will include all immediate content such as lists/libraries, but will exclude all child webs of the web.

Note that on the import, the Wizard will bring in all the contents of the selected .cmp file(s) - there is no option to partially import a package. Hence if different import options are required for different content, the exports should be broken into separate chunks.

Export options

On the export settings screen, numerous options can be applied to exports:

  • 'Exclude dependencies of selected objects' - by default the Content Migration API will automatically include dependent objects of whatever you select. This can include CSS files, master pages, images and the like, but also list items which are displayed on a page included in the export. This can be turned off with this checkbox so only the objects you select are exported.
  • 'Export method' (options are 'ExportAll', 'ExportChanges') - for now ExportAll is the option to select, ability to export changes only will come in a future release
  • 'Include versions' (options are 'LastMajor', 'CurrentVersion', 'LastMajorAndMinor', 'All') - should be self-explanatory
  • 'Include security' (options are 'None', 'WssOnly', 'All')' - note that since security is defined at the level of a web, selecting one of the include security options for a smaller object (e.g. list) actually exports security for the entire web. Both 'WssOnly' and 'All' export SharePoint item-level object permissions, so if you're using SharePoint groups to manage security for example, both the actual permissions and groups will be carried over, and you can add a different set of users/AD groups on the destination. See Migrating Security Information on MSDN for more details.

Import options

On the import we also have several options, some of which correspond to options selected on the export:

  • 'Import web URL' (actually shown on the 'Bind to site' screen) - this is used for reparenting operations only. If you are just moving content from source to destination but are not changing the location in the structure, this textbox can remain blank. Alternatively, for operations where a web or list is being imported but the parent web will not be the exact same web on the destination, the URL of the new target web URL should be entered.

    Note that the later option to 'Retain object IDs and locations' should not be selected when reparenting, since we are changing the location in this case.
  • 'From single file'/'From multiple files' options - the Wizard always exports with file compression enabled, so when exporting content over 25MB, files are split into several files at this threshold. When importing from such an export, select the 'From multiple files' option and browse to the folder. In the textbox, enter the 'base filename' - this should be the name of the first file without the number e.g. 'MyExport.cmp' rather than 'MyExport1.cmp'. 
  • 'Retain object IDs and locations' - this setting requires particular consideration. Duplicate GUIDs are not permitted in one database (i.e. SP web application), so the choice often depends on what you are importing. If you are taking a site from development to production, the object GUIDs will not yet exist on the destination, so I check the box to ensure the objects are assigned the same IDs in both environments, and all linkages are preserved. If you are reparenting a list or web, you will leave the box unchecked, so that new GUIDs are assigned are the location can therefore be changed.

    I highly recommend reading the content listed in the 'Useful links' section at the end of the article to properly understand this setting.
  • 'Include security' - this allows security information in a package to be imported, assuming one of the options to include security was selected on the export
  • 'Version updates' - allows control over whether new versions should be added to existing files, or whether the existing version should be replaced etc.
  • 'User info update' - allows control over whether 'last modified' information should be imported. Often this only makes sense if the same set of users exist in the source and destination

Scenarios quick reference

The following table lists the most common settings for a given deployment task:

Deployment item

Typical settings

Entire site collection
  • Site collection should first be created on the destination.
  • When exporting, select 'include all descendents'.
  • When importing for the first time, ensure 'retain object IDs and locations' is checked.
  • Select one of the 'include security' options if you wish to deploy object permissions and users
Web
  • When exporting, select 'include all descendents'.
  • When importing for the first time, ensure 'retain object IDs and locations' is checked if web will have same parent as on source.
  • If web will have a different parent, do not check retain object IDs and locations' and ensure 'import web URL' is specified
Document library/list
  • When exporting, select 'include all descendents'.
  • When importing for the first time, ensure 'retain object IDs and locations' is checked if list will have same parent as on source (i.e. not reparenting).
  • On subsequent imports, ensure 'import web URL' is specified if not importing to the root web, and do not check 'retain object IDs and locations'
File/list item
  • Ensure the parent library/list exists on the destination
  • Do not check 'retain object IDs and locations' if the item already exists on the destination

 

So hopefully that's some useful reference information. On a final note, the next beta version with much improved treeview performance should be ready over the next week or so!

Useful links

96 comments:

Albert Eltawil said...

This is one heck of a useful tool. I tried it out and managed to deploy my MOSS site from one server to another without any issue.

I do have a question, though. When will the tool be able to only deploy 'changes' done to a certain site instead of a complete site deployment?

Chris O'Brien said...

Hi Albert,

Thanks for the feedback. In terms of deploying incremental changes, this is something I'd definitely like to add - it's useful to hear other people would find this useful.

There are some tidy-up bits ahead of this in the queue, but I'll add it to the list of things to consider. Afraid I can't make any promise on the date though, realistically it could be a month or two.

Thanks,

Chris.

maina said...

Great post, and it looks like a useful tool. One question: If the tool is used to do initial deployment (to a new production site for example), can a SP content deployment job still be used to schedule subsequent deployments?

Chris O'Brien said...

Hi Maina,

Yes this will be absolutely fine as the same underlying API is used. The one stipulation is that in the Wizard, you check the box marked "Retain object IDs and locations" when deploying. This ensures objects in your site have the same IDs in both the source and target - content deployment jobs expect this to be the case. See "Mixing deployments with and without retaining object identity" on Stefan's content migration API 'common problems' post for more background on this.

Cheers,

Chris.

Albert Eltawil said...

Hey Chris,

We would like to be able to deploy multiple copies of the same master site to several site collections on the same web application. Currently when attempting to do this, we receive a message indicating there are duplicate object ID in the database.

Thank you and I hope to hear back from you soon.

Chris O'Brien said...

Hey Albert,

Yes, SharePoint will not let you store two objects with the same ID in one database. I'm wondering if you are selecting the 'Retain object IDs and locations' checkbox when importing - in this scenario, I think you should NOT be.

HTH,

Chris.

Anonymous said...

Hi Chris,

I'm trying to import a complete site collection, however I'm getting an obscure error on import.

The import fails with:
FatalError: The element 'Field' in namespace 'urn:deployment-manifest-schema' cannot contain text.

From looking in the log it appears that the element its failing on is WorkflowTasks/NewForm.aspx

I'm trying to migrate a PublishingSite, and I read somewhere that I need to create a blank site as the initial template to deploy into, but that doesn't seem to help.

Any ideas?

Thanks,

Justin

Chris O'Brien said...

Hi Justin,

Hmm that is pretty obscure, not heard that one before. However you're correct in what you say - content deployment does require the target site to be created with the blank site definition. Since it also requires that both the source/target site are based on the same definition, this means you should select blank when creating the site in development too.

This is a bit of a gotcha with content deployment in SharePoint which I probably should have been more explicit in reminding people about. In short, I'd probably expect things to fail in your scenario, but with a different error message (indicating what I've just said). It could be that this is actually your problem though.

I think I once saw some tips on how to move off one site definition to another - suggest searching for this.

HTH,

Chris.

Zarek said...

Hi Chris! Thanks for this useful tool. It would be good if it could Export folders from a particular document library, and import these files to a document library with a different name nudge nudge wink wink.

Chris O'Brien said...

Hi Zarek,

Interesting. I'm due to look at enhancing the reparenting options pretty soon so this might not be too far away.

Thanks for the feedback.

Chris.

Juha said...

I have been able to export a site (dev2) collection successfully.

When I import it like so:
site url: http://server/sites/dev2
import web url http://server/sites/dev/dev2

It completes with no errors or warnings but when I browse to ../sites/dev/dev2 there is nothing there. Any suggestions?

Neil said...

Hi Chris, the tool looks extremely helpful. Thank you for spending so much of your spare time building it and explaining how it works.

As somebody who is new to Sharepoint, but is looking to build an accelerator for clients (essentially create a template for a certain type of company for them to deploy and fill with content), I'm looking for any gotchas.

Presently, I am planning to make heavy use of site columns, programmatic events and content types, and will possibly walk into a client site with some of their data pre-loaded.

From what you've said, I should start with a blank slate and deploy a to a clean site collection on their side.

Incremental updates should be less of a challenge although I can imagine a scenario where I go in, deploy to dev >> build content >> deploy staging >> deploy to production.

Any thoughts / things to research before I dive in would be appreciated. Haven't coded since VS 2003, so using the content deployment api is a bit daunting. If possible I'd be keen to avoid it.

Cheers

Neil

Chris O'Brien said...

Hi Juha,

I suspect that since you exported the site collection, this will have imported to /sites/dev2.

If this is the case, it could be possible that if you could just select the root web of the site collection, you would be able to move the web in the hierarchy but at present, when selecting the root in the treeview you are selecting the site collection. Site collections cannot be reparented (location in hierarchy changed) in the same way webs can.

A way to work around this would be to do a 2nd export from /sites/dev2, and then on the import, enter the import web URL for the real location you want. You can then delete the site at /sites/dev2.

Hopefully this should work fine. I'd also suggest checking the import log file to see if the site actually just didn't import for some other reason.

HTH,

Chris.

Chris O'Brien said...

Hi Neil,

Thanks for the feedback.

I'd expect you should be able to use the tool fine for this scenario. In most cases though, I see the tool being used in combination with Solutions/Features to deploy reasonably complex sites. The content migration API (and hence the Wizard) is not capable of deploying all components of a SharePoint site, so filesystem assets such as assemblies/files which go into the 12 folder etc. should be deployed with Solutions/Features. You'll generally need to deploy these first before importing content, since otherwise the import will fail and report that something (e.g. a Feature) from the source site is not present on the destination.

Suggest having a look at some my 2007 articles for info on Solutions/Features.

HTH,

Chris.

Garth said...

This tool is great thank you!
I spent 1.5 days messing around with random stsadm import/export issues compared to the 1 hr from finding your tool to having my site moved from Dev to Test Environment. Thank you.

My findings:
- I added a new column and content to the Test Server and then redployed a site from Dev. The column and content on the Test Server remained after the site was redeployed.

A few questions:
1) What's happening with the databases? For example if I have a content database for a site collection on the Target Server but only import a subsite from the Source Server will a new content database be created for the imported subsite on the Target Server? Or will content be added to the existing Target Server's content database? Or something else?

Chris O'Brien said...

Garth,

Thanks for taking the time to feed back. Your experience with STSADM export was basically what prompted me to write the tool ;-) And yes, because the Wizard allows selective deployment of items, no content on the target environment should be overwritten accidentally.

In terms of databases, content will be added to your target site's existing content database.

HTH,

Chris.

Ross said...

Hey Chris,
Loving the concept, but I CANNOT get it to work. I think maybe I am just understanding SharePoint bits wrong as I am a newbie. I am trying to move a few lists from a site on one server to a site on another. I export the lists, including dependents..no worries. this is with Beta 2

Then, I move the cmp file to a share that is accessed by the new server. Original URL is:
http://Server1/PWA/Reporting
I have created a new website on server 2 under:
http://Server2/PWA/Reporting

When I import, I select the cmp file and put the Site URL as:
http://Server2/PWA/Reporting and run it....it fails with "The file Lists/Issues cannot be imported because its parent web /EPM Reporting does not exist" - I have tried as many combinations of this, using both site URL and Import Site URL, and also the retain ID option....basically it always fails with some version of the error message above...Can you tell me what I am doing wrong?

Many thanks in advance

Chris O'Brien said...

Hi Ross,

That's an interesting error, as it's suggesting that the reparenting instruction isn't quite right (since it's trying to import to "/EPM Reporting" rather than "/PWA/Reporting"). The set of parameters you need are:

- do NOT check 'retain object IDs and locations'
- enter the 'import web URL' of the web if you are not importing to the root web on the target

However, I actually think the main cause is because you are on beta 2. The Content Migration API had some big known issues at this time - I'd be surprised if you didn't get errors. Is there a specific reason why you're still using this release 1 year+ after RTM?

Chris.

Ross said...

Sorry...I should have been clearer. The Beta referred to the codeplex, not the project server install....DOH!

Thanks for responding though. Will try what you say and get back to you....server itself is playing games at the moment, so may have something to do with it!

Cheers
R

Chris O'Brien said...

Ah right, beta 2 of the Wizard! Sorry, should have realized that's what you meant :-)

Get back to me if you're still having issues..

Cheers,

Chris.

sh said...

Hello Chris,

I have the same problem as in the last post by Ross.
This happens just on some specific website.
Can this be due to a SharePoint bug ?

Chris O'Brien said...

@sh,

It's possible this is caused by a SharePoint bug - especially if you don't have SP1 and the latest hotfixes for Content Deployment. However, I've only seen this particular message when the parent website genuinely isn't there. Are you sure the parent web is present on the destination? Also, have you performed any imports on the destination without retaining object IDs (perhaps by using STSADM import?) - this could result in the parent web being there but with a different GUID, which could confuse the issue.

HTH,

Chris.

Anonymous said...

Hi Chris,
I am using the content deployment API for a project.
Is there any way we can increase the cab file size to be more than 25 mb.
So API does not break the files ...

Thanks
Ajay

Chris O'Brien said...

@Ajay,

You can use the SPExportSettings.FileMaxSize property for this. See http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spexportsettings.filemaxsize.aspx for more details.

HTH,

Chris.

Tajeshwar said...

I have a ques about feature activation. DO I need to activate features or as Stefan articles say PRIME automatically tales care of activating features. They only need to be installed.

Couls you please clarify.

Chris O'Brien said...

@Tajeshwar,

Stefan is correct - PRIME/content deployment will activate any Features which need to be active for the target environment to match the source, but they do need to be installed first.

HTH,

Chris.

Anonymous said...

Hi

I keep getting an unhandled exection error (access denied) even when logged onto box as local admin.

I'm using v1.1

Any suggestions please?

Steve

Chris O'Brien said...

Hi Steve,

Do you mean the 1.1 version I uploaded to Codeplex today (22 Sept)? In any case, would you mind replying with your e-mail address (I won't publish to the blog) so I can work through this problem with you?

Many thanks,

Chris.

Anonymous said...

I got an error when importing a site collection from dev to a blank site collection in production:

[10/17/2008 9:11:03 AM]: FatalError: Could not load file or assembly 'ReservationEventHandler, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
at Microsoft.SharePoint.SPEventReceiverDefinition.ValidAssembly()
at Microsoft.SharePoint.SPEventReceiverDefinition.ValidReceiverFields()
at Microsoft.SharePoint.SPEventReceiverDefinition.UpdateInternal(Boolean isMigration)
at Microsoft.SharePoint.Deployment.EventReceiverSerializer.UpdateEventReceiver(SPEventReceiverDefinition eventReceiver, XmlElement eventReceiverData, SPImportSettings settings)
at Microsoft.SharePoint.Deployment.EventReceiverSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
at Microsoft.SharePoint.Deployment.ContentTypeSerializer.UpdateEventReceivers(SPContentType contentType, String contentTypeXml, StreamingContext context, ISurrogateSelector selector)
at Microsoft.SharePoint.Deployment.ContentTypeSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
at Microsoft.SharePoint.Deployment.XmlFormatter.ParseObject(Type objectType, Boolean isChildObject)
at Microsoft.SharePoint.Deployment.XmlFormatter.DeserializeObject(Type objectType, Boolean isChildObject, DeploymentObject envelope)
at Microsoft.SharePoint.Deployment.XmlFormatter.Deserialize(Stream serializationStream)
at Microsoft.SharePoint.Deployment.ObjectSerializer.Deserialize(Stream serializationStream)
at Microsoft.SharePoint.Deployment.ImportObjectManager.ProcessObject(XmlReader xmlReader)
at Microsoft.SharePoint.Deployment.SPImport.DeserializeObjects()
at Microsoft.SharePoint.Deployment.SPImport.Run()


Please help,

PJ

troyhunt said...

Hi Chris, great tool that got me out of a seriously hairy position this week. One question though; if you export a sub-site of a site collection can you import this as a root site collection on another box? All my attempts resulted in it being restored as a sub-site within the target site collection rather restoring AS the root site.

Thanks,

Troy.

Chris O'Brien said...

@PJ,

Typically this error means exactly what it says - an assembly which was present on the source environment cannot be found on the target environment. In your case I see it seems to be referring to one of the SharePoint system assemblies - has anything been deleted from the GAC accidentally?

On another angle, I do remember seeing an odd occasion where the assembly this error complained about genuinely was present, and without changing anything the error went away (and the import succeeded) after rebooting..

HTH,

Chris.

Chris O'Brien said...

@troyhunt,

Interesting one - I'm actually not sure it's possible to reparent an exported web so that it replaces the existing root web of a site collection. I've got a feeling it should be possible somehow though!

You could try asking Stefan Gossner for the appropriate parameters to pass to the Content Deployment API for this. From there you might be able to either work out what to do in the Wizard, or you may need to tweak the Wizard code slightly to support this scenario.

Sorry if that's not the simple answer you were looking for..

Chris.

Carin said...

Hi Chris,

I'm fairly new to SharePoint but recently launched a Publishing website with content (some 4000 pages) imported from and external source. Now I have been tasked to automate an import procedure for quarterly updates to aforementioned content without overwriting edits done after the initial import and preserving a content web part managed at the page level on each of the 4,000 pages.

Is this wizard the best way (or even A way at all) to achieve this?

Thanks!

Chris O'Brien said...

Carin,

Yes, I think that you should be able to use the Wizard code (available at www.codeplex.com/SPDeploymentWizard as a starting point for your tool. (N.B. I don't think you can use the Wizard as is since it doesn't yet support automation/scripting).

If I've interpreted your requirements correctly, using the Content Deployment API in the same way the Wizard does should tick all your boxes.

HTH,

Chris.

Elvis said...

Hi,
I'm working with WSS 3.0SP1 and am trying to export a list (http://server/SiteA/SubSiteA/List)from a subsite and import it into a different site in the same Sharepoint parent site (http://server/SiteB/List).. Export seems to work fine, but when I import, I get .NET errors. I'm using http://server for the Site URL and http://server/SiteA for the Import web URL. The error I get is System.ArgumentException: Value does not fall within the expected range... Any ideas to help me get through this... I'll save my praise comments after I get this to work :) Thanks!!

Chris O'Brien said...

Hi Elvis,

Wise man ;-)

Could it be that a Feature isn't present/activated in the web you are importing to? I've seen this error come up when Features aren't in sync (since Content Deployment expects them to be).

Otherwise, assuming you're up-to-date with SP1 and other updates (which fixed some issues with Content Deployment), the only things I can suggest unfortunately are:

- checking the SharePoint logs/Wizard log for more clues on where it's failing
- searching for others who have also run into this error using Content Deployment

Cheers,

Chris.

P.S. That was typo wasn't it - you're specifying http://server/SiteB as your import web URL right?
P.P.S. And you're not ticking 'retain object IDs and locations' (since you can't retain IDs when reparenting an object)?

Elvis said...

Chris,
Thanks for the fast response! I checked site features for both sites and they the features installed and active are the same. Could I create a 2nd list with a different name at the same location for testing?
I think I might not have been clear in my original post. We have multiple subsites corresponding to business units that are all under our main portal page, would I consider those sites or subsites? If subsites, then.... source is http://server/site/subsiteA/list and destination is http://server/site/subsiteB/list

thx!

Chris O'Brien said...

Elvis,

In that case you should use 'http://server/site/subsiteB/' as your import web URL if you're not already. This value always corresponds to the web you wish to import the object to - so whether it's a web or list you're importing, always specify the path to the direct parent web.

HTH,

Chris.

Elvis said...

Chris,
The product worked like a CHARM!!! I'll gladly sing your praises now. If you are ever in the Hartford, Connecticut area let me know... drinks on me!

Thanks again for your help!
Elvis

Chris O'Brien said...

Elvis,

Excellent, glad you got sorted :-)

Chris.

Elvis said...

Hmmm, when I attempt to import a list from another subsite, I get the following once it starts importing Threaded.aspx.. I get Microsoft.Sharepoint.SPException: Error in the application.. at ....SPList.UpdateDirectoryManagementService(STring oldalias, String newalias)... any ideas?

thx

Elvis said...

Hmm, I think it might have something to do with the fact that the Discussion lists all have the same web address (General discussion in the link).. anyone know how to customize this?

Anonymous said...

I am exporting and importing a Discussion board using this tool, it completes fine, but when I check the site. It just doesn't have anything from the exported site! No errors!

I am a local administrator on the server as well as Farm administrator, so no issues with the permissions.. Am I missing any steps?

I am exporting and importing All and am not excluding anything, no retain identity flag ticked etc.

I am bit lost here, any help will be much appriciated.


Thanks
Meera

Elvis said...

I got it squared away Chris.. Used Sharepoint Designer 2007 to change the actual list names, then your tool had no problems exporting/importing the lists... Awesome tool!

Chris O'Brien said...

@Meera,

Hmm, sounds slightly suspicious. I wonder if you are perhaps expecting the imported content to be found in a certain location, but the import has actually put it somewhere else?

Does the import log file have any errors/warnings?

Thanks,

Chris.

Chris O'Brien said...

@Elvis,

Good sleuthing! Glad to hear you got sorted..

Chris.

Rob said...

Chris:

Great tool. Worked perfectly.

Thanks for sharing it with us.

Rob

Alex said...

Hey Chris,

I was trying to use the CDW to reparent a site, but for some misterious reason it doesn't do what I want it to do.

I have a top-level site in site collection A (http://server/sites/siteA), which I want to move to a sub-site in site collection B (http://server/sites/siteB/newloc).

So I export the whole site from A and select to import it a blank site in B. The import parameters I use are:

Site URL: http://server/sites/siteB
Import web URL: http://server/sites/siteB/newloc (where newloc is an empty site)
Preserve Identity: no

But when the import runs, I end up with content of siteA being copied to the root siteB, not under newloc.

What am I doing wrong?

Thanks and keep on your great work!
Alex

Brandon said...

i'm trying to export a list and am getting an error. I was hoping you could help.

Error:
[3/27/2009 10:42:22 AM]: Progress: Starting to process objects of type ContentType.
[3/27/2009 10:42:22 AM]: FatalError: Field type Tag is not installed properly. Go to the list settings page to delete this field.
at Microsoft.SharePoint.SPFieldCollection.CreateSPField(Int32 index)
at Microsoft.SharePoint.SPFieldCollection.EnsureSPField(Int32 index)
at Microsoft.SharePoint.SPFieldCollection.get_Item(Int32 iIndex)
at Microsoft.SharePoint.SPFieldCollection.ItemAtIndex(Int32 iIndex)
at Microsoft.SharePoint.SPBaseCollection.SPEnumerator.System.Collections.IEnumerator.get_Current()
at Microsoft.SharePoint.SPContentType.get_Fields()
at Microsoft.SharePoint.Deployment.ContentTypeSerializer.GetDataFromDataSet(Object obj, SerializationInfo info, StreamingContext context)
at Microsoft.SharePoint.Deployment.DeploymentSerializationSurrogate.GetObjectData(Object obj, SerializationInfo info, StreamingContext context)
at Microsoft.SharePoint.Deployment.XmlFormatter.SerializeObject(Object obj, ISerializationSurrogate surrogate, String elementName, Boolean bNeedEnvelope)
at Microsoft.SharePoint.Deployment.XmlFormatter.Serialize(Stream serializationStream, Object topLevelObject)
at Microsoft.SharePoint.Deployment.ObjectSerializer.Serialize(DeploymentObject deployObject, Stream serializationStream)
at Microsoft.SharePoint.Deployment.SPExport.SerializeObjects()
at Microsoft.SharePoint.Deployment.SPExport.Run()

Thanks,
Brandon

Chris O'Brien said...

@Alex,

Sorry for the delay in getting to your comment, I've been completely snowed under.

Hmm - I think there might be a limitation of the Wizard here that you've ran into - I don't think you're doing anything wrong with those parameters.

What I think is happening is that when you select a top-level site, it's being taken with the 'Site' tag when in your case you want to take it with the 'Web' tag (since you effectively want to export the root web of that site collection, rather than the site collection itself). At the moment, the Wizard doesn't allow you to specify.

I'll add this to my task list for enhancements to the Wizard.

Unfortunately, my only suggestion for now is to modify the code if you (or someone you work with) has development skills. It would be a one-liner to change the code once the right place is found. If you go down this path and need any help from me, feel free to get in touch.

Otherwise I hope to add this in to the current release over the next 2 weeks or so if you can wait that long!

Sorry for the inconvenience..

Chris.

Chris O'Brien said...

@Brandon,

Sorry for the delay in getting to your comment, I've been completely snowed under.

Is 'Tag' a custom field type rather than a standard field? Typically this error occurs when something isn't quite right in the definition for a custom field (e.g. in your fldtypes*.xml file)

HTH,

Chris.

Kostas said...

Chris hi,

let me start by thanking you very much for this useful tool. I've used it regularly for several purposes (lists, webs, collection) and i am very pleased by its performance.
A quick question about the site collection deployment.
We tried to deploy a site collection from one farm to another (retaining object ids). It worked like a charm :-)
The thing is we want to use the Content Deployment feature of Moss for our future content deployment. Should we do a full deployment or will the quick deployment (incremental) do the trick??
If its the former is there a way (a token or something) so as to not fully deploy again the same content (8 Gbs is a lot)...

Thanx again for your time,

Chris O'Brien said...

@Kostas,

Glad you find the tool useful :-)

If I understand the question properly, you're asking if you should use the incremental option with standard Content Deployment? In general, you should do the first deployment as a full, then subsequent deployments can be incremental. This would be the recommended approach.

Also note that I'm hoping to add incremental deployment to my tool over the next month or so.

HTH,

Chris.

BN said...

Hi Chris,

We are looking at deploying the items in Reusable Content, and some document libraries with pages that makes use of these reusable content from our development to the client's UAT environment. Is is possible to achieve this using your tool without having to create a blank site at the destination? Because there are existing subsites, lists etc that we do not wish to over-write.

When I select just required items in the Reusable content list and do an import specifying the Import URL as "http://dev.abc.com/ReusableContent", I get a error like "object reference not found ...". Grateful if you can offer any advice on this, thanks.

Chris O'Brien said...

@BN,

Yes, it is possible to import Reusable Content items into a site which already has data, done it many times.

The mistake you're making is putting "http://dev.abc.com/ReusableContent" in the Import Web URL box - since the ReusableContent list is a list in the root web of a publishing site (not a subweb), you should not specify anything for the Import Web URL.

HTH,

Chris.

Nick said...

Hi Chris,

My organisation is starting to rebuild the company intranet using Sharepoint, and I've been given the joyful task of sorting out deployment processes. I love the look of this wizard, just one thing I wonder if you can answer for me. One of the things we always have to document is backout plans in the event of a deployment failing / users not happy (as if!) / whatever. What would be the backout method using the CDW? As I see it, the 2 options are:
1) backup prior to deployment then restore from that backup
2) use stsadm -retractsolution(though presumably this is only for .wsp solution deployments?)

Is there anything I have missed? And does the CDW include an option to retract deployments?

Many thanks,
Nick

Chris O'Brien said...

@Nick,

Unfortunately, deployments in SharePoint are not transactional, so you have to do some work with backups to ensure you have a good roll-back position. This is the case for both:

- deployment of assets using WSPs
- content deployment (e.g. with my Wizard or by configuring OOTB content deployment in Central Admin)

I note that you seem to be confusing the two slightly. The Wizard does not do anything with wsps (i.e. deployment *or* retraction) - this is typically done separately with any deployment scripts you might have. This will take care of any filesystem assets you have (12 hive files, Features, SPWebConfigModifications etc.). THEN, as a subsequent step, content deployment is used to deploy the actual content (e.g. webs, lists, list items, pages etc.) from source to target.

So I suggest backup of filesystem AND content database is used to establish your rollback position before deployments. Indeed the Wizard prompts you with a warning before doing an import as a reminder. Backup tools such as Data Protection Manager 2007 simplify this process if you're able to use them.

HTH,

Chris.

Anonymous said...

Hi Chris,

Thanks for the great tool! Regarding the tool, is there any way to export at the site level without having the content on the target destination be overwritten if it already exists?

Basically, I want to update my home page of the target site with the home page of my development site without having to update anything else.

Thanks in advance for any response.

Chris O'Brien said...

@Anonymous,

Not currently - the tool does not yet support incremental deployment (i.e. only deploy changed content). However I'm hoping to build this into the tool over the next few weeks :-)

Out of interest, is there any reason why you can't select your homepage only and deploy that? Or am I not understanding your scenario properly?

Thanks,

Chris.

Steven said...

Chris,
Is this tool useful when migrating a Sharepoint server that has its content database stored on a separate server? The content database will not be moving - it is staying on the same database server. The rest of Sharepoint needs to be moved to a new server though.

Anonymous said...

Hi Chris,

Thanks for the quick response.

Maybe I am using the tool incorrectly?

This is a structure of what I have:

- http://site
-http://site/subsite1
- subsite1 - DocumentLibrary1
- subsite1 - DocumentLibrary2
-http://site/subsite2

When using your tool for export, I selected "http://site" - "Exclude descendents" & "Exclude dependencies".

When I imported the file, I selected "Retain object IDs and locations" with the version options of "Append". Doing this updated the homepage of http://site as I needed but it also updated the contents in subsite1 - DocumentLibrary1 and subsite2 - DocumentLibrary2 which I did not want to do...

I am not seeing where to select the homepage to update only just that?

Btw, I am looking forward to your incorporation of the incremental deployment in the tool!!

Thanks!!

Chris O'Brien said...

@Steven,

Hmm, I'm not exactly sure what you mean by that. Do you mean that your changing the web server used in your SharePoint implementation? If so, then no - you'd only need to add your new box to the existing farm then remove the old one. This tool would not be used in that scenario.

HTH,

Chris.

Chris O'Brien said...

@Anonymous,

Hmm interesting - I would have expected selecting 'Exclude dependencies' would have done what you're looking for. Notably if your site uses the MOSS publishing Feature you can just select the homepage in the Pages library and deploy that, but I'm guessing your site doesn't.

It could be that you've found a bug. I'm starting the process of implementing incremental deployment this weekend, so will take a look when I'm in the code.

Thanks,

Chris.

Anonymous said...

How is the incremental deployment going? This looks like just what we need. We are moving from QA to a Production server soon. Would like to use this tool and in the future for any upgrades we make.

Chris O'Brien said...

Good timing :)

I'm in the last stages of dev/testing, should be up on Codeplex (along with a blog article here) in the next few days. As always, be interested to hear if you run into any problems, leave a comment here or on Codeplex and I'll try my best to help.

Thanks,

Chris.

tanga said...

Hi,
Will this work when exporting from 32 bit to a different server in a 64 bit environment ?

Chris O'Brien said...

@Tanga,

Yes that should be absolutely fine, nothing in the deployment process would care about x86 or x64.

HTH,

Chris.

Sean said...

Hi Chris,

I'm having fun with the incremental export (using the 2.5 Beta). I select 'ExportChanges' from the drop down list, and it immediately comes up with a message box, "Unable to perform incremental export - the Wizard did not find a stored change token for the largest object you have selected to export. This could be because a full export for the site or web has not yest been performed using this version of the Wizard".

What I did was performed an 'Export' on the site, passed the .cmp to our production guys to implement on the live server, then made changes to the site. I have checked the change log and there appear to be 'add' items corresponding to the number of items I added to the site, and the guid in the log matches the guid of the site.

Any ideas what I may be doing wrong? Could there be something in the logging settings that is somehow affecting what is being picked up?

This is not to detract from a great tool; this is not a major issue for us as the full export works ok; however, as the site grows, it will be good to be able to update with just the changes.

Many thanks.

Chris O'Brien said...

@Sean,

If I understand correctly, are you saying that you have performed a full export (using the 2.5 beta or later of the Wizard - this is important), and then subsequently see the message you quote when you try to do an incremental?

What happens if you do another full export, make some changes and then try the incremental again?

Thanks,

Chris.

Archeious the Librarian said...

I am trying to move a document library from one subsite to a different site. Is this possible? When importing what do I put in the urls? I am confused what goes where. Do I put the address I want it to go?

Sean said...

Thanks for replying so promptly, Chris. Yes, I am using the 2.5 beta of the wizard. I have now tried doing another full export and making changes, and I'm getting the same again. Not helpful, am I!!!

Thanks for your help....

Sean

Chris O'Brien said...

@Sean,

Sorry for the delay, have been travelling back from the big SharePoint Conference. I can't seem to recreate this, but I'll keep trying - in the meantime, can you explain more about what environments you have/where you're doing the export/import etc?

Thanks,

Chris.

Chris O'Brien said...

@Archeious the Librarian,

When importing, the values to use should be:

- Site URL: the URL for the site collection e.g. http://intranet/
- Import web URL: the URL for the site within the site collection e.g. http://intranet/hr/

Hope that makes sense.

Chris.

David Perry said...

Chris - I am experiencing the same issue as Sean regarding the incremental export. A little more detail: I'm using version 2.7 of the wizard, exporting from a MOSS 2007 SP2 document workspace with several DWS subsites. The subsites are based on a saved template, permissions inheritence is broken, and there are event receivers on some of the libraries that are part of the saved template. Other than that there is not anything special about the sites. I have had success on this site doing full deploys. I have also tried making changes and then trying the incrememntal after a full, but the same same issue occurs. Hopefully that helps? Thanks, Dave

Chris O'Brien said...

@Sean, @David Perry,

This is now a confirmed bug - apologies for the inconvenience. Not sure exactly when I'll be able to resolve it, but it definitely will happen sometime over the next few weeks. The Codeplex site will have the details.

For now I can only suggest doing full exports.

Thanks for the reports.

Chris.

Anonymous said...

Thank you very much Chris your tool is great and I copy lists from one site to another, and it works great with under any web application even if WAP uses host headers or not but I have one web application which using AAM with host headers and extended for external and custom, copy list process completes successfully, import and export logs completes successfully with no errors but when I open the destination site, list does not exist at the destination site. If I tried to copy same list under another site which does not use host header and not extended and it copies successfully.

Anybody has same or similar problem or list what might be go wrong? Anybody has any idea where is the copied list at the destination?

Chris O'Brien said...

@Anonymous,

I don't think AAM should have any effect on Content Deployment, so I'm not sure what to say. Have you checked everywhere in your site structure in case you used some options and weren't sure which destination you'd end up with?

HTH,

Chris.

Vijay said...

Hi Chris,

I want to use the SPExportSettings.FileMaxSize property to set the maximum size of my exported package to 1 GB. I have tried it but that is no working. Even after setting this property, the package still be broken in two parts.

I am not sure what is missing. Any help is highly appreciated.
Thanks,
Vijay

Chris O'Brien said...

@Vijay,

I did some research and found your (answered) post at http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/0f10490e-1ccb-41ac-8922-b2848808ae44. So it seems you can use "1023" but not "1024" - good info, thanks.

Chris.

VishwajitWalke said...

Hi Chris,

Thanks for this great tool !! I've an issue of Importing Custom SQL Server Report Viewer Web Part. After Importing, this web part failed to view the report as it contains Export Server Name in its Report Server Path. I've gone through Manifest.xml but no such attribute found where I thought to replace the Export Server name with Import Server's.

Another thing I've tried is Exporting a web part to .dwp file and then importing it. It also failed with same error. So, I just renamed the .dwp file to .xml and changed the ReportServerPath Attribute to point to Export Report Server. And it worked !!

Is there a possible work-around for it ?

Vishwajit

Garry said...

Hi Chris,

Great tool, Thanks.

I did an export and disabled compression. Is there any documentation on the command-line to import?

Garry

Chris O'Brien said...

@Garry,

Yes I have documented this properly somewhere, but in my completely professional way I now can't find where. Let me try to explain here:

- follow steps 6 and 7 of the process in Command-line support for Content Deployment Wizard
- edit the generated XML file to ensure that the 'FileLocation' attribute points to the folder path where all the files are stored, there is no 'BaseFileName' attribute, and FileCompression is set to 'False'

Feel free to reply again here if you run into problems.

Thanks,

Chris.

vishwajitwalke said...

Hello Chris,

This is in continuation of my previous post about "Export / Import of Custom SSRS Report Viewer Web Part". We've came up with partial work around for this issue, details of which can be found at MSDN Forum :

http://social.msdn.microsoft.com/Forums/en/sharepointbi/thread/402f4df1-3caa-4ae1-b9ad-25b69a410192?prof=required

Your assistance would be much appreciated to make this "fully-working".

Thanks,
Vishwajit

Chris O'Brien said...

@vishwajitwalke,

I read your post in the MSDN forums. Unfortunately it looks like this is just a limitation of the SSRS Report Viewer web part - if it hardcodes an absolute URL I can't think of any course of action other than what you have done. Either that, or simply edit the web part page *after* the import has been done on the target.

Sorry I can't be more help.

Chris.

El Turco said...

Hello Chris, first of all thank you for sharing this tool.
I have a little problem when trying to migrate reports(from reporting services) this reports are on a Document Library, and when the import procedure is starting the tool is saying for every particular report that it's located there.

Thanks for help!!
Laureano.

Chris O'Brien said...

@Laureano,

Can you tell me what the exact error message is?

Thanks,

Chris.

vishwajitwalke said...

Hi Chris,

This is in continuation with my earlier post about "Problem in Import / Export the SSRS Web Part". We've come up with a concrete solution for this issue. Please refer the resolution at this thread :
http://social.microsoft.com/Forums/en-US/partnerdevsql/thread/6d7ac7d0-71e0-43a0-97c5-faaf3a678765

Thanks. Vishwajit

Anonymous said...

Hi Chris,

Thanks for creating such a great tool. I've been testing a lot of things with it, and I generally understand it. But I do have a question. I am dealing with moving an entire site collection from location A to location B. I am aware that, if the URL of A is http://source/myApp/site and the URL of B is http://destination/myApp/site, then I should leave the 'Import Web URL' field blank and check the 'retain object IDs' box. However, what if the URL of A is http://source/myApp/site and the URL of B is http://destination/otherApp/otherSite? Then do I have to specify an 'Import Web URL'? And should I check the 'retain object IDs' box? The reason I ask is because you say "if it is reparented" to specify the 'Import Web URL' field. But in that situation, is it being reparented or not? And why? My thoughts are that it IS being reparented in the second situation I mentioned, simply because the "top level site" (as SP calls it when you create a new site collection) is different on the destination than it is on the source. Thanks.

-Kyle

Chris O'Brien said...

@Kyle,

Great question. In fact, the content *isn't* being reparented in the example you mention - this is reparenting really refers to anything *beneath* a site collection, rather than a site collection itself. So reparenting examples include moving a web to another place in the structure/moving a list to another web etc.

This is basically because a site collection is the boundary for many things in SharePoint, including references between objects.

HTH,

Chris.

Anonymous said...

Hi Chris, Kyle here again. Thanks a lot for your previous reply, that helps to clarify. As a follow up question, what if I had already completed the move I described in my previous post (i.e., now both /webApp/site and /otherApp/otherSite have the same site collection on them). Now I want to move a SINGLE site called "HelpSite". On /webApp/site it is located at /webApp/site/HelpSite and I'm moving it to /otherApp/otherSite/HelpSite. I'm assuming that, according to your prior explanation, I do NOT need to specify an Import Web URL since no reparenting is occurring? In other words it is not the URL itself that matters, it is only the location of the item that you are moving relative to the entire site collection. So if the whole site collection is at /1/2 on the source and at /1/2/3/4 on the destination, you can still safely move ONE site from /1/2/SiteBeingMoved to /1/2/3/4/SiteBeingMoved since its location relative to the site collection has not changed. Sorry if those examples were confusing. And again, your product is great, immensely helpful, and I appreciate you taking the time to respond to my comments.

-Kyle

Chris O'Brien said...

@Kyle,

Happy to help!

I had to give this one some thought, but yes you're right - because the path within the site collection is not changing, this *isn't* a reparenting operation. Consequently you shouldn't specify an Import Web URL.

It does get slightly tricky thinking some of these scenarios through, but something which simplifies it is remembering that SharePoint's Content Deployment framework is based on the idea of creating an exact mirror between source/destination. When you pick up some content, it has a reference to the path within the site collection - any time you change that, you are reparenting and need to tell it where the new path is via the Import Web URL.

HTH,

Chris.

Anonymous said...

Hi Chris

Love your tool. I was able to easily copy a list from one site to another. One thing I keep getting errors with is when I try to do the export of one item from a list. The error message says the list item does not exist. Any idea of what I might be doing wrong?

Thanks
Jennifer

Chris O'Brien said...

@Jennifer,

It sounds like you're specifying 'Retain object IDs and locations' - this would cause the import to look for the list by ID, and maybe the list doesn't have the same ID as where you exported the item from.

What happens if you try again without this checkbox checked?

Thanks,

Chris.

Anonymous said...

Hi Chris

Thanks for the reply. The issue I was having was getting errors when trying to export one list item. I think it is an issue with this particular list since this site has a lot of problems. I was able to export the whole list and import to another site. I then tried to do an export of one item from this new site and didn't have any issues. So, I am set.

Thanks
Jennifer

Darren said...

Thank you so much for this tool Chris, it saved my life. After spending considerable time trying to get test and live environments to match up using the microsoft way and hitting the most un helpful errors, your tool came to the rescue and did it one. Thank you for this, an amazing piece of software.

perry said...

Have problem with import of documentlibrary or customlist in moss 2007, sp2 installed.

Trying to export document library from one site collection to another.

import log, says

FatalError: Specified cast is not valid.
at Microsoft.SharePoint.Deployment.ListSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
at Microsoft.SharePoint.Deployment.XmlFormatter.ParseObject(Type objectType, Boolean isChildObject)
at Microsoft.SharePoint.Deployment.XmlFormatter.DeserializeObject(Type objectType, Boolean isChildObject, DeploymentObject envelope)
at Microsoft.SharePoint.Deployment.XmlFormatter.Deserialize(Stream serializationStream)
at Microsoft.SharePoint.Deployment.ObjectSerializer.Deserialize(Stream serializationStream)
at Microsoft.SharePoint.Deployment.ImportObjectManager.ProcessObject(XmlReader xmlReader)
at Microsoft.SharePoint.Deployment.SPImport.DeserializeObjects()
at Microsoft.SharePoint.Deployment.SPImport.Run()

works fine in sharepoint foundation 2010.

what could be the problem.