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

[Part 1Part 2Part 3Part 4Part 5 – Part 6 – Part 7]

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

114 Comments


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

    Reply

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

    Reply

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

    Reply

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

    Reply

  5. Fantastic, incredibly detailed, content on content deployment by Stefan

    Reply

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

    Reply

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

    Reply

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

    Reply

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

    Reply

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

    Reply

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

    Reply

  12. 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.

    Reply

  13. 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

    Reply

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

    Reply

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

    Reply

  16. MOSS / SharePoint Content Deployment

    Reply

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

    Reply

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

    Reply

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

    Reply

  20. 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

    Reply

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

    Reply

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

    Reply

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

    Reply

  24. Maybe on your screen.

    Not with a screen width of 1200 and more.

    Reply

  25. 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&quot; xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;

     <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

    Reply

  26. Hi Bramley,

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

    Cheers,

    Stefan

    Reply

  27. 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&quot; xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;

     <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.

    Reply

  28. 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

    Reply

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

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

    Reply

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

    Reply

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

    Reply

  32. 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 Settingsrameshk>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

    Reply

  33. 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

    Reply

  34. 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

    Reply

  35. 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

    Reply

  36. 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

    Reply

  37. 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

    Reply

  38. [ Part 1 – Part 2 – Part 3 – Part 4 – Part 5 – Part 6 ] Requirements for a successful content deployment

    Reply

  39. 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

    Reply

  40. Hi Akhanna,

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

    Thanks,

    Stefan

    Reply

  41. Fantastic article on WSS content migration / MOSS content deployment API

    Reply

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

    Reply

  43. 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

    Reply

  44. Hi Kieran,

    sites and sub-sites: yes

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

    Cheers,

    Stefan

    Reply

  45. 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

    Reply

  46. 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

    Reply

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

    Reply

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

    Reply

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

    Reply

  50. Can someone explain the difference between ExcludeChildren and IncludeDescendants?

    Thanks

    Reply

  51. Hi Timothy,

    I have explained this in part 2.

    Cheers,

    Stefan

    Reply

  52. 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

    Reply

  53. 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

    Reply

  54. 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

    Reply

  55. 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

    Reply

  56. 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

    Reply

  57. 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

    Reply

  58. how could we migrate list without list item?

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

    Reply

  59. 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

    Reply

  60. 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

    Reply

  61. 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

    Reply

  62. 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

    Reply

  63. Hi Varun,

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

    Cheers,

    Stefan

    Reply

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

    Reply

  65. Hello Stefan,

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

    Reply

  66. 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

    Reply

  67. 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.

    Reply

  68. Hi Lili,

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

    Cheers,

    Stefan

    Reply

  69. 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 FilesCommon FilesMicrosoft SharedWeb Server Extensions12TEMPLATEFEATURES 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

    Reply

  70. 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

    Reply

  71. 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

    Reply

  72. Hi Anand,

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

    Cheers,

    Stefan

    Reply

  73. 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

    Reply

  74. 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

    Reply

  75. Hi Stefan,

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

    In which event we have to anchor our code?

    Reply

  76. Not importing, at the time of exporting.

    Reply

  77. 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

    Reply

  78. 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

    Reply

  79. Hi Intekhab,

    this is by design if RetainObjectIdentity is false.

    Setting this to true will avoid this problem.

    Cheers,

    Stefan

    Reply

  80. 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

    Reply

  81. 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

    Reply

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

    Reply

  83. 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

    Reply

  84. 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

    Reply

  85. 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

    Reply

  86. 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

    Reply

  87. 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

    Reply

  88. Hi Sara,

    yes, content types are transferred.

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

    Cheers,

    Stefan

    Reply

  89. 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

    Reply

  90. Hi Stefan,

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

    Thanks

    Vedanshu

    Reply

  91. Hi Vedanshu,

    yes this is possible.

    Cheers,

    STefan

    Reply

  92. 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.

    Reply

  93. 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

    Reply

  94. 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.

    Reply

  95. 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

    Reply

  96. 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.

    Reply

  97. 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

    Reply

  98. 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!

    Reply

  99. 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

    Reply

  100. Hi Stefan

    I have the following error on Contend deploy

    The list item cant be deleted becourse the collection do not exist.

    This happens if a user creats a list and before the deploymentjog is running the user then delete thislist again.

    2. Senario is that if a user delete a pages and the rename the site, before the deployjob is running.

    I both cases the dployjob fails becource the page cant be deleted becource the destanation is not there.

    Haw can u force a full deploy, that overright thise errors ?  

    Reply

  101. Hi Torben,

    please verify if this happens if you have MOSS 2007 with SP2 and December 2009 CU installed.

    If yes, you should open a support case to get this addressed.

    Cheers,

    Stefan

    Reply

  102. Hi Stefan,

    I am trying to Moving Pages inside PageLibrary from one location to another location using SPExport/SPImport  as i want all metadata information (Last Modified date, created date, modified by etc..) to be as it is

    I am using below code..

    For Exporting list item..

           SPExportSettings exportSettings = new SPExportSettings();

               exportSettings.AutoGenerateDataFileName = true;

               exportSettings.ExportMethod = SPExportMethodType.ExportAll;

               exportSettings.SiteUrl = siteURL;

               exportSettings.IncludeSecurity = SPIncludeSecurity.None;

               exportSettings.IncludeVersions = SPIncludeVersions.All;

               exportSettings.OverwriteExistingDataFile = true;

               exportSettings.CommandLineVerbose = false;

               SPExportObject exportObject = new SPExportObject();

               exportObject.Id = li.UniqueId;

               exportObject.ExcludeChildren = true;

               exportObject.IncludeDescendants = SPIncludeDescendants.Content;

               exportObject.Type = SPDeploymentObjectType.ListItem;

               exportSettings.ExportObjects.Add(exportObject);

               Trace.WriteLine("Starting export of URL : " + siteURL);

               using (SPExport export = new Microsoft.SharePoint.Deployment.SPExport(exportSettings))

               {

                   export.Run();

               }

    For Importing ListItem…

           SPImportSettings importSettings = new SPImportSettings();

               importSettings.BaseFileName = System.IO.Path.GetFileName(fileToImport);

               importSettings.FileLocation = System.IO.Path.GetDirectoryName(fileToImport);

               importSettings.SiteUrl = siteURL;          

               importSettings.RetainObjectIdentity = false;        

               importSettings.IncludeSecurity = SPIncludeSecurity.None;

               importSettings.UpdateVersions = SPUpdateVersions.Ignore;

               importSettings.UserInfoDateTime = SPImportUserInfoDateTimeOption.ImportAll;

               importSettings.CommandLineVerbose = false;

               Trace.WriteLine("Starting import to URL : " + siteURL);

               using (SPImport import = new SPImport(importSettings))

               {

                   import.Started += new EventHandler<SPDeploymentEventArgs>(import_Started);          

                   import.Run();

               }

    It’s working fine and keeping metadata information only if page is having more then one version. If page is having only one version (major or minior) then it’s changing modified date to current date.

    do i missing any settings ? or is it a limitation of MOSS 2007 ?

    Anybody has face this kind of issue ?

    Thanks,

    Mehul

    Reply

  103. Hi Mehul,

    sounds to me as if you don’t have the latest hotfixes installed. A similar issue was in October CU.

    Cheers,

    Stefan

    Reply

  104. We had installed the Moss 2007 Cummulative updates for December 2009 last month.

    Few Days before we found out that Content deployment jobs scheduled on our Farm are not running. When we start this content deployment jobs manually, it remains in the status – “Preparing”

    Any inputs from your side

    Regards,

    Lakshman

    Reply

  105. Hi Lakshman,

    that is not a known issue.

    I would suggest to test April 2010 CU which was released this week and if the problem persist to open a support case with Microsoft.

    Cheers,

    Stefan

    Reply

  106. I understand that the Move/Copy action in the Site Content and Structure tool uses the content migration API. This means that when I move a page it's actually doing a content migration from one Pages list to another. We have a situation whereby if there are no variations in a site collection, or a single source variation, an authenticated user can move or copy a page provided they have Manage Permissions enabled in their profile. However, if the same user attempts to move/copy a page when there is a source variation and one or more target variations, they get the following error:

    <error><message>Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))</message>

       <full>Microsoft.SharePoint.SPException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) —> System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex) at Microsoft.SharePoint.Deployment.SPExport.Run() at Microsoft.SharePoint.Publishing.Internal.DeploymentWrapper.MoveItems(String[] sourceSmtObjectIds, String destSmtObjectId) — End of inner exception stack trace — at Microsoft.SharePoint.Publishing.Internal.DeploymentWrapper.MoveItems(String[] sourceSmtObjectIds, String destSmtObjectId) at Microsoft.SharePoint.Publishing.Internal.WebControls.MoveItems.Copy()</full>

       <customData>Operation to Move 'atestpage.aspx' to '/internet/can/en/home/Pages' Failed</customData></error>

    Only a site collection administrator can move/copy pages when there are one or more target variations. I could understand it if it failed for the first scenario, i.e. needing a certain level of permissions in order to move/copy a page at all using the API, but it seems crazy to have one scenario work and another fail.

    Reply

  107. I understand that the Move/Copy action in the Site Content and Structure tool uses the content migration API. This means that when I move a page it's actually doing a content migration from one Pages list to another. We have a situation whereby if there are no variations in a site collection, or a single source variation, an authenticated user can move or copy a page provided they have Manage Permissions enabled in their profile. However, if the same user attempts to move/copy a page when there is a source variation and one or more target variations, they get the following error:

    <error><message>Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))</message>

       <full>Microsoft.SharePoint.SPException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) —> System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex) at Microsoft.SharePoint.Deployment.SPExport.Run() at Microsoft.SharePoint.Publishing.Internal.DeploymentWrapper.MoveItems(String[] sourceSmtObjectIds, String destSmtObjectId) — End of inner exception stack trace — at Microsoft.SharePoint.Publishing.Internal.DeploymentWrapper.MoveItems(String[] sourceSmtObjectIds, String destSmtObjectId) at Microsoft.SharePoint.Publishing.Internal.WebControls.MoveItems.Copy()</full>

       <customData>Operation to Move 'atestpage.aspx' to '/internet/can/en/home/Pages' Failed</customData></error>

    Only a site collection administrator can move/copy pages when there are one or more target variations. I could understand it if it failed for the first scenario, i.e. needing a certain level of permissions in order to move/copy a page at all using the API, but it seems crazy to have one scenario work and another fail.

    Reply

  108. Hi Stormbringer, I just tested the scenario and found the same when trying to copy. The problem seems to occur when resolving content type dependencies. You might want to open a support case if you need to export the items with a user less than site collection administrator.

    Reply

  109. Dear Stefan,

    I just sent email to you yesterday, not sure you have received the email. So I would like to post it in here to you.  Currently, we met content import error about "Import failed:Microsoft.SharePoint.SPException: Cannot import version 4.0 because only version 3.0 was exported". I doubt the root cause is user publish content update during the exporting job running. Not sure if it's a bug for MOSS, would like to seek your help on how to prevent such error. Many thanks!

    Reply

  110. Hi Frankie,

    looks as if the export was done from SharePoint 2007 and the import was tried on SharePoint 2010. That is not supported.

    You cannot export/import cross version.

    Cheers,

    Stefan

    Reply

  111. We are going implement content deployment job in SharePoint 2013 site. We don’t have separate STAGING environment for act as a source of the content deployment.

    My Proposal design is EX: A,B and C are my web applications. Webapp-A (Test site) and Webapp-B(Staging) in both are same farm. Staging will be act as a source of content deployment
    WebApp C is Production and act as destination of content deployment.
    We have custom code to deploy web application level and only one feature at FARM level.

    Will content deployment job work without fail ? if we deploy and activate the new feature only in Webapp-A not in Webapp-B since both are in same FARM.
    We have around 2000 pages in PROD. Can we continue with existing site or content deployment will work only for empty template for first moving from source to destination?

    Reply

  112. Is there any limitation while using stsadm command import/export. Like if custom role/groups are used will that also get exported/imported to the new subsite location. I am getting "FatalError: The given key was not present in the dictionary.

    at System.ThrowHelper.ThrowKeyNotFoundException() " error in import log while importing. Is there any workaround or location to look at to find a fix this issue.

    Thanks & Regards

    Reply

  113. Hi Pradeep,
    there are no known limitations in this area.
    The description sounds more like a db inconsistency.
    Cheers,
    Stefan

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.