Welcome to TechNet Blogs Sign in | Join | Help

Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

[Part 1 - Part 2 - Part 3 - Part 4 - Part 5 - Part 6]

Introduction 

Today I would like to start an article series on an interesting new feature in WSS 3.0: the Content Deployment and Migration API. A similar API has previously been provided in MCMS 2002 and was also added to WSS after MCMS was integrated in MOSS 2007. This first part will provide an overview about the API itself. In future chapters I will then demonstrate how to utlize this API to enhance your own applications or to get a better granularity than the out of the box tools allow you to do - e.g. how to copy a document library or a list to a different site collection.

WSS and MOSS use this API at various different places:

  • Content Deployment
  • STSADM -o export and import
  • Copy/Move operations in Site Manager
  • Variations
  • MCMS 2002 database migration to MOSS 2007

Actually any time when content needs to be copied or moved to a different location either in the same or in a different site collection.


Feature set of the Content Deployment and Migration API

The Content Deployment and Migration API provides the following features:

  • export an entire site collection
  • export a specific site inside a site collection including or excluding content in subsites
  • export a list or document libraries or even of a folder inside a document library
  • export a single list items or documents from a document library
  • export dependent objects (like images referenced by a page) by following links
  • generate as a compressed export file or in uncompressed format
  • allow export with a define a maximum size for the generated compressed file (multiple export files will be created if required)
  • allow incremental export of items based on a given change token. This will export all items that have been created, changed or deleted after the timestamp in the change token.
  • import the exported content with or without identiy preservation (means items will keep their GUID or not)
  • import the exported content under the same or a differnt parent in the destination database
  • do link fixup during import

For people who have also worked with Microsoft Content Management Server (MCMS) 2002 here is a feature comparison between the site deployment API of CMS 2002 and the content deployment and migration API coming with WSS:

   
MCMS 2002
 
WSS 3.0
incremental deployment  
yes
 
yes
full deployment  
no
 
yes
deployment of a subtree of the site structure  
yes
 
yes
deployment of specific selected items  
no
 
yes
deployment of dependent items  
yes
 
yes
deployment by ignoring the dependencies  
no
 
yes
deployment of child elements of the exported elements  
yes
 
yes
deployment without exporting of child elements  
no
 
yes
import with preservation of the last modified date of the source item  
no
 
yes
import without preservation of the last modified date of the source item  
yes
 
yes
export of image libraries/resource galleries  
no
 
yes
support import at multiple locations in the site hierarchy  
no
 
yes
can be used to migrate 3rd party content  
no
 
yes


Programming Reference

Assembly: Microsoft.SharePoint.dll
Namespace: Microsoft.SharePoint.Deployment

Important Objects:

  • SPExport - controls the Export process
  • SPExportSettings - used to configure the export process
  • SPExportObject - defines which objects need to be exported
  • SPImport - controls the import process
  • SPImportSettings - used to configure the import process

You will find details about these objects in the MSDN:
http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.aspx

Rather than listing all the different properties and methods of these objects (which are already documented on MSDN) I will explain how to use these objects by providing some "real-world" samples in the next chapters:

  • Part 2 - Providing some real world samples on export
  • Part 3 - Providing some real world samples on import
  • Part 4 - Advanced content deployment scenarios
  • Part 5 - Avoiding common problems
  • Part 6 - Requirements for a successful content deployment
Published Thursday, August 30, 2007 6:47 PM by Stefan_Gossner

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# MSDN Blog Postings » SharePoint Content Deployment and the Migration API

Friday, August 31, 2007 12:41 AM by Noticias externas

# SharePoint Content Deployment and the Migration API

Stefan is back! J Stefan is in Redmond this week, and we had a chance to catch up! In fact, I had dinner

Friday, August 31, 2007 5:32 AM by SharePoint, SharePoint and stuff

# Deep Dive in SharePoint Deployment und Migration API

Stefan Goßner taucht in einer vierteiligen Serie in die Tiefen der SharePoint Deployment und Migration

Friday, August 31, 2007 5:41 PM by Stefan Goßner

# Deep Dive into the SharePoint Content Deployment and Migration API - Part 3

[ Part 1 - Part 2 - Part 3 - Part 4 ] Providing some real world samples for import After we managed to

Friday, August 31, 2007 5:41 PM by Stefan Goßner

# Deep Dive into the SharePoint Content Deployment and Migration API - Part 2

[ Part 1 - Part 2 - Part 3 - Part 4 ] Providing some real world samples for export To demonstrate how

Friday, August 31, 2007 9:40 PM by Andrew Connell [MVP MOSS]

# Fantastic, incredibly detailed, content on content deployment by Stefan

Fantastic, incredibly detailed, content on content deployment by Stefan

Friday, August 31, 2007 10:00 PM by Mirrored Blogs

# Fantastic, incredibly detailed, content on content deployment by Stefan

[via Stefan Gossner ] This past week I was in Redmond teaching my WCM401 development class in an open

Sunday, September 02, 2007 2:03 PM by Jorge Dieguez Blog

# Migración de contendidos SharePoint de forma programática

En la última versión de SharePoint se ha incluido un interesante conjunto de herramientas que permite

Monday, September 03, 2007 6:03 AM by Mirrored Blogs

# Content migration API "Deep Dive" by Stefan Goßner

Body: Great series of posts by Stefan on how to use the Content Migration API. Very timely for me as

Tuesday, September 04, 2007 1:03 PM by Microsoft Enterprise Content Management (ECM) Team Blog

# A deep dive into the SharePoint Content Deployment and Migration API

If you haven't seen it already, Stefan Goßner has published a great series on how to develop using the

Thursday, September 06, 2007 2:36 AM by Shared Points...

# Stefan Goßner Deep Dives into SharePoint Content Deployment

Stefan Goßner has published a four article series on how to develop using the Content Deployment and

Tuesday, September 11, 2007 11:02 AM by Joycode@Ab110.com

# SharePoint内容部署与迁移API

今天凌晨加班的时候偶然翻到 Stefan Gossner 的这几篇文章,强烈推荐给大家: Deep Dive into the SharePoint Content Deployment and Migration

Tuesday, September 18, 2007 5:43 PM by David Remillard

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

I'm having difficulty with export/import of a site from one farm to another.  The problem has to do with the Data View Web Parts that are in the site.  Apparently, they persist reference to the GUID of the datasource (list)?  Do you have any guidance for this scenario?  Thanks.

Wednesday, September 19, 2007 3:10 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi David,

is the list the data view web part points to also in the package?

Anyway: I would suggest to open a support call to get investigated if this should work or not.

I personally haven't looked into the details of this till now.

Cheers,

Stefan

Saturday, September 22, 2007 11:11 AM by Mirrored Blogs

# Brilliant and detailed view of content management API

Stefan Goßner has put together a terrific 4-part series on the SharePoint Content and Deployment API

Tuesday, September 25, 2007 5:49 AM by Connecting Systems the Microsoft Way

# MOSS / SharePoint Content Deployment

Great set of articles by Stefan Goßner : Deep Dive Into the SharePoint Content Deployment...

Friday, September 28, 2007 2:38 AM by Connected Systems Chilled Out Blog

# MOSS / SharePoint Content Deployment

MOSS / SharePoint Content Deployment

Sunday, October 14, 2007 7:47 PM by Mirrored Blogs

# Deployment using STSADM export or content migration API

Having focused on deployment using Features for several articles, back in May I wrote an article titled

Monday, October 29, 2007 7:43 AM by Mirrored Blogs

# STSADM export, Content Deployment, Content Migration API, Features/Solutions - deployment options compared

Back in May I wrote a post titled SharePoint deployment options : Features or Content Deployment? , which

Thursday, November 22, 2007 12:40 PM by Jenny

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Can you deploy content from a MOSS environment to a WSS environement?

Thursday, November 22, 2007 3:00 PM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Jenny,

MOSS is on top of WSS. As long as you are only using WSS features in the deployed content it will work. As soon as you are trying to deploy content that is bound to features which are only available in MOSS it will fail.

Cheers,

Stefan

Friday, November 30, 2007 6:04 PM by Microsoft SharePoint Developer Documentation Team Blog

# Content Migration in SharePoint

Around the time work started on a long whitepaper about migrating content files from SharePoint server

Friday, November 30, 2007 6:21 PM by Noticias externas

# Content Migration in SharePoint

Around the time work started on a long whitepaper about migrating content files from SharePoint server

Wednesday, December 12, 2007 10:33 AM by gbelzile

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

FYI... the diagram is truncated on the right.

Wednesday, December 12, 2007 11:07 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Maybe on your screen.

Not with a screen width of 1200 and more.

Tuesday, January 29, 2008 8:58 AM by Bramley

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan

I have been working with content deployment in MOSS2007. It worked well before. Currently I'm getting the following error:

<?xml version="1.0" encoding="utf-8" ?>

- <ArrayOfReportMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 <ReportMessage Title="Unknown compression type in a cabinet folder" Time="2008-01-29T13:40:31.2983868Z" Severity="Error" Phase="ExportInProgress" />

 <ReportMessage Title="Failed to create package file. at Microsoft.SharePoint.Deployment.ExportDataFileManager.<>c__DisplayClass2.<Compress>b__0() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.Deployment.ExportDataFileManager.Compress(SPRequest request) at Microsoft.SharePoint.Deployment.SPExport.Run() *** Inner exception: Unknown compression type in a cabinet folder at Microsoft.SharePoint.Library.SPRequest.BuildCabinetFile(String bstrTempDirectory, String bstrCabFileLocation, UInt32 uMaxCabFileSize) at Microsoft.SharePoint.Deployment.ExportDataFileManager.<>c__DisplayClass2.<Compress>b__0()" Time="2008-01-29T13:40:35.5170828Z" Severity="Error" Phase="ExportInProgress" />

 <ReportMessage Title="Content deployment job 'NewCompletePushTest' failed.The exception thrown was 'Microsoft.SharePoint.SPException' : 'Failed to create package file.'" Time="2008-01-29T13:40:49.9387732Z" Severity="Error" Description="" Recommendation="" Phase="Failure" />

 </ArrayOfReportMessage>

Here is the scenario:

I have just completed installing wss service pack 1, and MOSS 2007. The replication now gives the error above. My topology is as follows: I have two farms located in different located geographically. It was working before. This is a full-deployment not incremental.

please help

Tuesday, January 29, 2008 9:54 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Bramley,

please open a support case for this. This is not an issue I have heard about till now.

Cheers,

Stefan

Wednesday, January 30, 2008 12:03 AM by Bramley

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan

Do you think this has any thing to do with compression of files. How can I remove compression. I'm using MOSS - Central Administration for content deployment. This issue affect the increment updates. I get the following error for incremental:

<?xml version="1.0" encoding="utf-8" ?>

- <ArrayOfReportMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 <ReportMessage Title="The changeToken refers to a time before the start of the current change log." Time="2008-01-29T20:39:04.6175572Z" Severity="Error" ObjectName="/" Phase="ExportInProgress" />

 <ReportMessage Title="The changeToken refers to a time before the start of the current change log. at Microsoft.SharePoint.Deployment.SPExport.ThrowInvalidChangeTokenError(DateTime minChangeTime, Int32 minChangeNumber) at Microsoft.SharePoint.Deployment.SPExport.GetIncrementalChanges() at Microsoft.SharePoint.Deployment.SPExport.CalculateObjectsToExport() at Microsoft.SharePoint.Deployment.SPExport.Run()" Time="2008-01-29T20:39:04.8363044Z" Severity="Error" Phase="ExportInProgress" />

 <ReportMessage Title="Content deployment job 'NewCompletePushTest' failed.The exception thrown was 'Microsoft.SharePoint.SPException' : 'The changeToken refers to a time before the start of the current change log.'" Time="2008-01-29T20:39:05.8362916Z" Severity="Error" Description="" Recommendation="" Phase="Failure" />

 </ArrayOfReportMessage>

Any help will do.

Wednesday, January 30, 2008 3:07 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Bramley,

sure it is related to compression. The error message implies this.

The error for the incremental deployment indicates that your database is older than the last deployment.

This can happen if you have restored an older backup of the database. Then the deployment job definition does no longer fit to the source database.

Cheers,

Stefan

Monday, February 18, 2008 3:21 AM by Eric.Chai

# SharePoint列表导入/导出命令

在使用SharePoint的时候我们常常需要做这样一个操作:把某个列表(或文档库)从一个网站转移到另一个网站上去。

比较常见的做法是,把这个列表存为模板文件,然后再在新的网站位置创建一遍。但这种方法...

Monday, February 25, 2008 2:53 PM by Mike's Blog

# Deep Dive Into the SharePoint Content Deployment and Migration API

Stefan Goßner posted a great series of posts about the Content Migration API (formerly known as PRIME

Wednesday, February 27, 2008 8:36 PM by Mirrored Blogs

# New version of Content Deployment Wizard released

I&#39;m happy to announce that development/testing of the next version of the SharePoint Content Deployment

Friday, February 29, 2008 12:45 PM by Ramesh

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi

I've a big problem in the stsadm -restore command

We only had Site collection backups and we need one site the user deleted from the backup

We did the backup in the production server and one of the user deleted the site(:)) and we’re trying to get the site backup.

When we try to restore we're getting the following error

C:\Documents and Settings\rameshk>stsadm -o restore -url http://localhost -filename z:\projects.bak -overwrite

Your backup is from a different version of Windows SharePoint Services and cannot be restored to a server running the current version. The backup file should be restored to a server with version '3701403.0.1196032409.29915337' or later.

I saw few post on this error.

http://blogs.technet.com/wbaer/archive/2007/05/22/understanding-and-handling-microsoft-it-site-delete-capture-1-0-archives.aspx - I did install the MSITDelete Site capture on my local machine. Not sure that is the problem. If only have installed this the production, that would have saved almost two days and still no postive results

http://serverdays.com/2007/08/10/problems-using-stsadm-to-backup-windows-sharepoint-services-30/

But not any solutions though. I don't know whether Microsoft knows about this or something I'm not doing correctly.

And by the way, if I have backup using stsadm can I read it using Content API or any other tool which wil read the data and restore it

Any help will be greatly appreciated.

Thanks

Ramesh

Friday, February 29, 2008 12:49 PM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Ramesh,

this message means that the backup has been taken using SQL methods - not using STSADM -o backup.

You need to restore it using SQL methods. You cannot restore a SQL backup with STSADM.

Cheers,

Stefan

Monday, March 24, 2008 1:48 AM by Vedanshu

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi,

I am using Microsoft.Sharepoint.Deployment classes to create archives of sites using the code mentioned below. It used to work previously, but has started throwing the following exception

Failed to create package file

Unknown compression type in a cabinet folder

at Microsoft.SharePoint.Library.SPRequest.BuildCabinetFile(String bstrTempDirectory, String bstrCabFileLocation, UInt32 uMaxCabFileSize) at Microsoft.SharePoint.Deployment.ExportDataFileManager.<>c__DisplayClass2.<Compress>b__0()

Here's the code that I am using

SPSecurity.RunWithElevatedPrivileges(delegate()

               {

                   using (SPSite site = new SPSite(url))

                   {

                       using (SPWeb web = site.OpenWeb())

                       {

                           string strBackupfile = web.Title + ".cmp";

                           SPExportSettings exportSettings = new SPExportSettings();

                           if (ExportAll)

                               exportSettings.ExportMethod = SPExportMethodType.ExportAll;

                           else

                               exportSettings.ExportMethod = SPExportMethodType.ExportChanges;

                           exportSettings.BaseFileName = strBackupfile;

                           exportSettings.FileLocation = "C:\\";

                           exportSettings.ExcludeDependencies = false;

                           exportSettings.IncludeSecurity = SPIncludeSecurity.All;

                           if (IncludeAllVersions)

                               exportSettings.IncludeVersions = SPIncludeVersions.All;

                           else

                               exportSettings.IncludeVersions = SPIncludeVersions.CurrentVersion;

                           exportSettings.SiteUrl = url;

                           exportSettings.ExcludeDependencies = false;

                           exportSettings.CommandLineVerbose = false;

                           exportSettings.FileCompression = true;

                           exportSettings.OverwriteExistingDataFile = true;

                           SPExportObject ob = new SPExportObject();

                           ob.Type = SPDeploymentObjectType.Web;

                           ob.ExcludeChildren = false;

                           ob.Id = web.ID;

                           exportSettings.ExportObjects.Add(ob);

                           exportSettings.Validate();

                           SPExport export = new SPExport(exportSettings);

                           //export.Completed += new EventHandler<SPDeploymentEventArgs>(export_Completed);

                           //Run the damn thing.

                           export.Run();

                           //context.Undo();

                       }

                   }

               });

This works correctly if I set exportSettings.FileCompression to false. I have recently installed WSS and MOSS service packs. Can you please help me out?

Thanks

Vedanshu

Tuesday, March 25, 2008 5:04 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Vedanshu,

this is a common error if the compression fails due to insufficient disk space.

Please monitor the available disk space during export.

Cheers,

Stefan

Tuesday, March 25, 2008 5:52 AM by Vedanshu

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan,

I am running this process on a test site which is just a basic collaboration portal. The process used to work fine before we installed Sharepoint service packs. During those test runs, the size of archives created was less than 10MB with the available disk space being close to 22GB. So I guess disk space should not have  been a problem. I have also tried it with different filetypes (.cmp, .cab etc.)but have not been able to run it with compression enabled. The process works correctly if exportsettings.FileCompression is set to false.

Thanks

Vedanshu

Tuesday, March 25, 2008 6:15 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Vedanshu,

please monitor the space on ALL your disks - not only the destiation disk where the final package should be created.

During export the files are temporarily created on the drive where the TMP environment variable points to.

Cheers,

Stefan

Friday, April 11, 2008 7:37 PM by Stefan Goßner

# Deep Dive into the SharePoint Content Deployment and Migration API - Part 6

[ Part 1 - Part 2 - Part 3 - Part 4 - Part 5 - Part 6 ] Requirements for a successful content deployment

Tuesday, April 22, 2008 9:57 PM by akhanna

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan,

I have a timer job running which uses export settings class and creates a content package for all the items in a document library.

Now users upload files in this document library and I want only the approved items should be exported.

If I SPIncludeVersions.LastMajor , and I have anything where approval status is pending, I get the error message that

The object with Id<Guid)  that was configured as part of the Export Settings no longer exists.

If I change SPIncludeVersions.CurrentVersion then it exports all items even if the approval status is pending.

what do I need to do that people can upload to this list and only documents with status of approved are exported.

Thanks In Advance.

Cheers

Ajay

Wednesday, April 23, 2008 2:54 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Akhanna,

the error should not occur. Please open a support case to get this problem analyzed.

Thanks,

Stefan

Thursday, April 24, 2008 9:31 AM by Andrew Connell [MVP MOSS]

# Fantastic article on WSS content migration / MOSS content deployment API

Fantastic article on WSS content migration / MOSS content deployment API

Thursday, April 24, 2008 10:49 AM by Mirrored Blogs

# Fantastic article on WSS content migration / MOSS content deployment API

If you&#39;ve been under a rock like I have apparently over the last few months, you might not have noticed

Monday, May 05, 2008 4:15 AM by Kieran

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan

Would you suggest using SharePoint content deployment to move new sites/sub-sites and content types created by users from their local virtual development environment?

Best Regards

Monday, May 05, 2008 5:56 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Kieran,

sites and sub-sites: yes

Content types: no. These should be deployed using custom features. Not using content deployment.

Cheers,

Stefan

Wednesday, May 07, 2008 9:43 PM by jinzhuli

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan

I have a problem when i use Export to Backup a Web . Error Message: Failed to backup the web. Reason: Export ran out of memory while compressing a very large file. To successfully export, turn compression off by specifying the -nofilecompression parameter.

Thanks

jinzhuli

Thursday, May 08, 2008 2:51 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Jinzhuli,

the solution is clear: either go to a 64-bit environment where no similar memory limitations exist or use the parameter above to disable compression.

Cheers,

Stefan

Thursday, May 29, 2008 9:51 AM by Stefan Goßner

# Pimp My Content Deployment Job

As a follow up to my article series about the content deployment and migration API here are some tips

Monday, June 09, 2008 1:28 PM by kindohm.com

# SharePoint Site vs. Web exports/imports and Custom Layout Pages

SharePoint Site vs. Web exports/imports and Custom Layout Pages

Thursday, June 12, 2008 7:34 PM by Mirrored Blogs

# SharePoint Content Deployment API Article Series

Body: If you are deploying SharePoint you should take some time and read the following WSS/MOSS Content

Friday, July 25, 2008 4:27 PM by Timothy

# SPExportObject members

Can someone explain the difference between ExcludeChildren and IncludeDescendants?

Thanks

Saturday, July 26, 2008 5:21 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Timothy,

I have explained this in part 2.

Cheers,

Stefan

Thursday, September 11, 2008 2:49 AM by Ajay Khanna

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan,

I just read on a blog that Sharepoint designer workflows do not get migrated by Content Deployment... is this true?

Please advise/confirm...

Thanks

Ajay

Thursday, September 11, 2008 3:13 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Ajay,

content deployment deploys content. Not other things. Workflows should in general be deployed using features. With SPD workflows you might have to recreate the workflow on the target if really required.

As content should only be changed on the source and not on the target to ensure that content deployment works reliable might not make sense on the target anyway as workflows are used when content gets changed.

Cheers,

Stefan

Friday, October 31, 2008 6:39 AM by Rahul Singh

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi,

I am using the content migration API to import and export large video files (50-500 MB).

I am getting following error when one of the larger files around 300 MB are being attached : "Insufficient memory to continue the execution of the program. at Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem"

I have 2GB ram and x86 processor. This problem only occurs on 32 bit processors. Its working fine with x64 architecture.

I am using an external blog storage API to store these large files.

Please advise!!

Regards,

Rahul Singh

Friday, October 31, 2008 9:01 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Rahul,

are you doing this in a console application or in a web application?

In general it sounds like a design limitation. MOSS loads all items into memory before writing to the it to the database. Content deployment and migration API has a large memory footprint itself. With so large objects it might be that the 2 GB virtual memory per process (800 MB for ASP.NET application) is not sufficient. 64-bit is then the solution to go.

Cheers,

Stefan

Wednesday, November 12, 2008 7:53 AM by shobha

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi

I m getting this error  :

Progress: Importing ListItem /sites/components/MigratedUD?id=46.

[11/12/2008 10:56:41 AM]: Error: Invalid file name

The file name you specified could not be used.  It may be the name of an existing file or directory, or you may not have permission to access the file.

  at Microsoft.SharePoint.Library.SPRequest.CreateOrUpdateFileAndItem(String bstrUrl, String bstrWebRelativeUrl, Guid& docId, Object varDoc, Int32 docLength, Int32 exists, String bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Int32 iVersion, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String checkInComment, Int32 docLibRowID, String bstrListName, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage)

  at Microsoft.SharePoint.Deployment.FileSerializer.CreateOrUpdateFileWithGuid(SPFileStream spstm, SPWeb web, Guid fileId, String fileUrl, SPUser author, SPUser editor, String checkinComment, DateTime timeCreated, DateTime timeLastModified, MetaInfoHandler metaInfo, FileInfo fileInfo, Int32 iVersion, Boolean isFirstVersion, SPImportSettings settings, Int32 listItemId, String listInternalName)

Thanks in advance

Shobha

Wednesday, November 12, 2008 8:19 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Shobha,

you are trying to import into a not empty database. An item with the same name but with different GUID is already in the database and that causes the problem.

Cheers,

Stefan

Monday, February 02, 2009 1:51 AM by Intekhab

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

how could we migrate list without list item?

How could we migrate list item version(list items are not files)?

Monday, February 02, 2009 2:57 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Intekhab,

you need to deploy the SPList object without Decendents.

For the list items with version you need to pick each SPList item separately and set SPExportSettings.IncludeVersions according to your needs.

Cheers,

Stefan

Wednesday, February 04, 2009 6:27 AM by Intekhab

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

hi Stefan,

when i am exporting list items, in which one is folder and under this folder there is list item.

i am getting this error

FatalError: Violation of PRIMARY KEY constraint 'PK__#ExportObjects____124F33FC'

. Cannot insert duplicate key in object 'dbo.#ExportObjects'.

The statement has been terminated.

Regards

Intekhab

Wednesday, February 04, 2009 7:08 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Intekhab,

a fix for this has been released a year ago or so.

Please ensure to have SP1 + December Cumulative Update for WSS and MOSS installed.

Cheers,

Stefan

Wednesday, February 11, 2009 4:13 AM by Varun

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi,

I am using the content migration API along with retain ID's to handle list's along with attachments.

I am exporting lot of list items together, Is there any way that i can perform some operations on these items just before importing using Content migration API by only using the export file.

I tried using the Started event handler with the API but it didn't work, I am looking for an event handler like ObjectImporting which will be called just before an object is about to be imported.

Please suggest!

Regards

Varun

Wednesday, February 11, 2009 5:46 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Varun,

afaik that cannot be done when using the option to retains object identity.

Cheers,

Stefan

Tuesday, February 17, 2009 12:26 PM by Microsoft Tech Blogs

# Content Deployment basics Sharepoint 2007 (MOSS)

Following are some of the things that I learned while doing the content deployment for one of my customers:

Saturday, March 21, 2009 4:06 AM by Sunil

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hello Stefan,

Just wanted to know "Does SPExport support multiple parallel jobs?" In other words is this class thread safe?

Monday, March 23, 2009 4:21 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Sunil,

it is not a matter of this object. WSS itself does not properly handle parallel execution of multiple export operations for the same database.

With other words: as long as the source databases are different you can execute them in parallel. But if the export should be for the same database you need to serialize them to avoid random errors.

Cheers,

Stefan

Tuesday, March 24, 2009 3:20 AM by Lili Wei

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan,

When we try to Export/Import a root site collection from one web application to another on the same server, the export task is finished successfully but when import the .cmp file, error happens:

[3/18/2009 9:42:10 AM]: Progress: Importing List List Template Gallery.

[3/18/2009 9:42:11 AM]: Progress: Importing List Master Page Gallery.

[3/18/2009 9:42:12 AM]: FatalError: Value does not fall within the expected range.

  at Microsoft.SharePoint.SPFileCollection.get_Item(String urlOfFile)

  at Microsoft.SharePoint.SPContentTypeCollection.Add(SPContentType contentType)

  at Microsoft.SharePoint.Deployment.ContentTypeSerializer.CreateContentType(SPContentType sourceContentType)

Any ideas? Thanks a lot.

Tuesday, March 24, 2009 4:59 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Lili,

please open a support case with Microsoft to get this analyzed.

Cheers,

Stefan

Thursday, April 02, 2009 5:20 AM by Lili Wei

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan,

We encounter another error when import a root site collection from source server to destination server. Here's error message:

[4/2/2009 4:58:27 PM]: Start Time: 4/2/2009 4:58:27 PM.

[4/2/2009 4:58:27 PM]: Progress: Initializing Import.

[4/2/2009 4:58:32 PM]: FatalError: Could not find Feature DataConnectionLibrary.

  at Microsoft.SharePoint.Deployment.ImportRequirementsManager.VerifyFeatureDefinition(SPRequirementObject reqObj)

  at Microsoft.SharePoint.Deployment.ImportRequirementsManager.Validate(SPRequirementObject reqObj)

  at Microsoft.SharePoint.Deployment.ImportRequirementsManager.DeserializeAndValidate()

  at Microsoft.SharePoint.Deployment.SPImport.VerifyRequirements()

  at Microsoft.SharePoint.Deployment.SPImport.Run()

[4/2/2009 4:58:33 PM]: Progress: Import Completed.

[4/2/2009 4:58:33 PM]: Finish Time: 4/2/2009 4:58:33 PM.

[4/2/2009 4:58:33 PM]: Completed with 0 warnings.

[4/2/2009 4:58:33 PM]: Completed with 1 errors.

We checked that the folder "DataConnectionLibrary" existed under C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES on destination server. I find out the solution on internet, which is to deactive the "DataConnectionLibrary" feature before export by command "stsadm -o deactivatefeature -name DataConnectionLibrary -url http://weburl -force

". Is there any better way to fix it? Thanks a lot.

Best regards,

Lili Wei

Thursday, April 02, 2009 5:30 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Lili,

just having the folder does not mean that the feature is installed.

You need to run STSADM -o installfeature ... to install the feature after copying the files to the folder.

Cheers,

Stefan

Monday, April 06, 2009 3:20 AM by Anand

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan,

Is it possible to create a new page in production server with site collection administrator permission.

I am facing this problem. I sucessfully created a new site but if i want to create a new page then it is redirecting to access denied page.(I am having site collection admin permission This production collection is in different box and it is deployed through content deployment job).

Regards

Anand

Monday, April 06, 2009 3:34 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Anand,

this sounds like a known issue that was fixed in the February CU.

Cheers,

Stefan

Monday, April 06, 2009 4:39 AM by Anand

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Thanks for your reply Stefan,

Can you give more details abouts this February CU. Do we need to run any service packs to fix this issue. Please suggest me.

Regards

Anand

Monday, April 06, 2009 4:51 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Anand,

Service Pack 1 + the February CU will be required.

In addition some steps are required to fix your existing database.

So please open a support Case with Microsoft to get the tools to fix this.

Cheers,

Stefan

Wednesday, April 08, 2009 7:05 AM by Intekhab

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan,

Can we change any file(.aspx page) at the time of importing?

In which event we have to anchor our code?

Wednesday, April 08, 2009 7:06 AM by Intekhab

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Not importing, at the time of exporting.

Wednesday, April 08, 2009 7:24 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Intekhab,

intersting question! Not directly on export - but afterwards.

During export you could register to the following event to achieve what you are looking for:

export.Compressing: here you can see the exported content before it is compressed into the cab file in a flat directory and are able to manipulate them (you would have to check in the manifest file which of the binaries relates to which file as the name changes. e.TempDirectoryPath will contain the directory that holds all the data.

Cheers,

Stefan

Thursday, April 16, 2009 1:20 AM by Intekhab

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan,

These list items are the hook in my neck. When i am migrating the site all the list items get duplicated each time.i know that this is the default behaviour of CMP API but is there any way to get rid while migrating the site? Please suggest something...

I googled for the same but all in vain

Regards

Intekhab

Thursday, April 16, 2009 2:45 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Intekhab,

this is by design if RetainObjectIdentity is false.

Setting this to true will avoid this problem.

Cheers,

Stefan

Tuesday, April 21, 2009 1:59 AM by Anand

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan,

This question is not related to content deployment issue, but i want to know if we modify any oob forms(eg: Workflow.aspx in 12 hive) and if we install service pack or patchs then what ever we have modified to the workflow.aspx will remain same or a new form will replace the older one. Please suggest me regarding this

Regards

Srivatsa

Tuesday, April 21, 2009 2:06 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Srivatsa,

modifying these files is unsupported.

Hotfixes and service packs could overwrite these files - or even worth: in some situations might not update the files which would mean that you end up with a mix of patches.

Before installing a fix you have to replace all modified files with the original version and then replace the fix to ensure that the hotfix installer can create a supported state.

Cheers,

Stefan

Saturday, May 30, 2009 12:40 AM by Manolo Herrera

# Bitácora de una migración SharePoint 2007

SharePoint tiene un API para migrar contenido efectivo y poderoso.&#160; Dentro del ensamblado Microsoft

Wednesday, July 08, 2009 1:27 AM by Srivatsa

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan,

I have two site collection, one is autuoring site and a production site and I am running content deployment job from authoring to production.

The question I activate one of the OOB feature at the site collection and run the content deployment job to a blank site collection. At that time it will activate all the features which are activated in the souce site.

After that i will deactivate one of the feature and run the content deployment job then deactivated feature wont be deactivated at the destination site. It will show the status as activated only.

How can we avoid this?

Regards

Sri

Wednesday, July 08, 2009 2:28 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Sri,

this cannot be prevented. It is by design. Content deployment does not explicit feature deactivation. It only activates features on site level that are activated when the site is provisioned.

If features need to be deactivated on the target you have to do this manually or using a script.

Cheers,

Stefan

Tuesday, July 28, 2009 12:13 AM by Sri

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan,

We are moving mcms application to Moss 2007 and it went sucessfully, but the problem is web parts are not displaying properly. All web parts are coming one below the other instead of one beside the other.I am guessing this is related to page layouts only. Just i wanted to know whether this migration does not support the page layouts.

Regards

sri

Tuesday, July 28, 2009 2:17 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Sri,

the template code is not migrated. A page layout is automatically generated for each template definition.

You need to adjust the page layouts to your needs afterwards manually.

Cheers,

Stefan

Tuesday, August 04, 2009 3:29 PM by Sara Tenenbaum

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan,

Do content types transfer over together with the rest of the site? (You mentioned needing a feature, but these are just part of the regular content type list). Is there a way to retain the GUIDs of the lists?

Thanks so much

Sara

Tuesday, August 04, 2009 3:40 PM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Sara,

yes, content types are transferred.

to retain the guid use RetainObjectIdentity as discussed in part 3.

Cheers,

Stefan

Tuesday, August 04, 2009 3:55 PM by Sara Tenenbaum

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi again,

Thanks for the extra quick reply! and for a fantastic group of posts. This is one part of SharePoint that I am looking forward when it matures. I am transferring a site with some nice XSL and hopefully this will help.

Best,

Sara

Monday, August 17, 2009 6:47 AM by Vedanshu Mandvikar

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan,

Can I import a CMP file created on a 32 bit SharePoint server installation on a 64 bit SharePoint installation.

Thanks

Vedanshu

Monday, August 17, 2009 6:54 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Vedanshu,

yes this is possible.

Cheers,

STefan

Thursday, August 27, 2009 3:03 AM by Ashish T

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan,

I have variation site structure as VariationRootsite then english and french site in parallen with in the same web application. I have a list say EnglishTest in english and want to move the list items from to EnglishTest list french site FrenchTest List. both lists has same template. I want to move list items from english site to french site. We want to retain object identity so that during next export-import operation the if any item in the english site being updated then it will reflect the update on the same item in french site also. Help is appriciated.

Thanks.

Thursday, August 27, 2009 3:13 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Ashish,

variation ensures that if an item updated in the source label gets sync'ed with the items in the target.

You don't have to bother about this.

As the items in the different labels have different URLs it is impossible to use RetainObjectIdentity here.

Moss deals with this by using a relationship list which binds source items to target items.

Cheers,

Stefan

Thursday, August 27, 2009 4:12 AM by Ashish T

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan, Thanks for the reply.

We have one more case. We have two site collection s in the same web application in same language. We want to keep few lists of SiteCollection2 in sync with the same lists of Sitecollection1. We want to migrate list items only using content migration APIs. we want to update the items also when they got updated in SiteCollection1. could you guide us how to get the same?

Thanks a lot.

Thursday, August 27, 2009 5:07 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Ashish,

updating items only works reliable when using RetainObjectIdentity.

Using this options has two limitations:

1) both site collections need to reside in different content databases

2) the site collection relative URL needs to be identical.

So if this can be accomplished it will work.

If not you would have to implement your own sync mechanism without using this API.

btw: why would you like to have the same data in two site collections?

You should be able to access the lists from a different site collection in your site as well.

Cheers,

Stefan

Saturday, August 29, 2009 7:45 AM by Hafriz

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Stefan, I have this irritating error:

The connection to the destination server was lost after the remote import job was started. The import job might still succeed. Content deployment will continue to attempt to reestablish a connection with the destination server

What could be the cause of this error? Both servers are in the same zone, and are hosting the same site. The source server is basically our authoring server while the destination is production end. I have deleted this job and path and recreated but i keep getting the same error.

Appreciate ur help in advance.

Saturday, August 29, 2009 3:21 PM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Hafriz,

sounds like a network problem.

Please check if you can see and problems in the IIS log of the target central admin site.

Cheers,

Stefan

Wednesday, November 04, 2009 11:51 AM by Phong

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

I am also getting this error with the content deployment:

The connection to the destination server was lost after the remote import job was started. The import job might still succeed. Content deployment will continue to attempt to reestablish a connection with the destination server.

It's stuck on "Running" for over 3 days now.  It doesn't give me the option to stop it or delete it.  How do I get rid of it?

Thanks in advance!

Thursday, November 05, 2009 12:18 AM by Stefan_Gossner

# re: Deep Dive into the SharePoint Content Deployment and Migration API - Part 1

Hi Phong,

if it is stuck on importing you can resolve this using the following steps:

1) navigate to http://central-admin-url/lists/content%20deployment%20jobs

2) edit the list item with the same name as the stuck job

3) change the value of the "LastStatus" field to "13"

4) navigate back to the content deployment paths and jobs page and you should have the option "Check Status" again.

5) do the check status and you will see if the job has succeeded or failed.

Cheers,

Stefan

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker