[Part 1 – Part 2 – Part 3 – Part 4 – Part 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:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
can be used to migrate 3rd party content | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
Permalink
PingBack from http://msdnrss.thecoderblogs.com/2007/08/31/sharepoint-content-deployment-and-the-migration-api/
Permalink
Stefan is back! J Stefan is in Redmond this week, and we had a chance to catch up! In fact, I had dinner
Permalink
Stefan Goßner taucht in einer vierteiligen Serie in die Tiefen der SharePoint Deployment und Migration
Permalink
[ Part 1 – Part 2 – Part 3 – Part 4 ] Providing some real world samples for import After we managed to
Permalink
[ Part 1 – Part 2 – Part 3 – Part 4 ] Providing some real world samples for export To demonstrate how
Permalink
Fantastic, incredibly detailed, content on content deployment by Stefan
Permalink
[via Stefan Gossner ] This past week I was in Redmond teaching my WCM401 development class in an open
Permalink
En la última versión de SharePoint se ha incluido un interesante conjunto de herramientas que permite
Permalink
Body: Great series of posts by Stefan on how to use the Content Migration API. Very timely for me as
Permalink
If you haven’t seen it already, Stefan Goßner has published a great series on how to develop using the
Permalink
Stefan Goßner has published a four article series on how to develop using the Content Deployment and
Permalink
今天凌晨加班的时候偶然翻到 Stefan Gossner 的这几篇文章,强烈推荐给大家: Deep Dive into the SharePoint Content Deployment and Migration
Permalink
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.
Permalink
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
Permalink
Stefan Goßner has put together a terrific 4-part series on the SharePoint Content and Deployment API
Permalink
Great set of articles by Stefan Goßner : Deep Dive Into the SharePoint Content Deployment…
Permalink
MOSS / SharePoint Content Deployment
Permalink
Having focused on deployment using Features for several articles, back in May I wrote an article titled
Permalink
Back in May I wrote a post titled SharePoint deployment options : Features or Content Deployment? , which
Permalink
Can you deploy content from a MOSS environment to a WSS environement?
Permalink
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
Permalink
Around the time work started on a long whitepaper about migrating content files from SharePoint server
Permalink
Around the time work started on a long whitepaper about migrating content files from SharePoint server
Permalink
FYI… the diagram is truncated on the right.
Permalink
Maybe on your screen.
Not with a screen width of 1200 and more.
Permalink
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
Permalink
Hi Bramley,
please open a support case for this. This is not an issue I have heard about till now.
Cheers,
Stefan
Permalink
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.
Permalink
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
Permalink
在使用SharePoint的时候我们常常需要做这样一个操作:把某个列表(或文档库)从一个网站转移到另一个网站上去。
比较常见的做法是,把这个列表存为模板文件,然后再在新的网站位置创建一遍。但这种方法…
Permalink
Stefan Goßner posted a great series of posts about the Content Migration API (formerly known as PRIME
Permalink
I'm happy to announce that development/testing of the next version of the SharePoint Content Deployment
Permalink
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
Permalink
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
Permalink
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
Permalink
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
Permalink
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
Permalink
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
Permalink
[ Part 1 – Part 2 – Part 3 – Part 4 – Part 5 – Part 6 ] Requirements for a successful content deployment
Permalink
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
Permalink
Hi Akhanna,
the error should not occur. Please open a support case to get this problem analyzed.
Thanks,
Stefan
Permalink
Fantastic article on WSS content migration / MOSS content deployment API
Permalink
If you've been under a rock like I have apparently over the last few months, you might not have noticed
Permalink
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
Permalink
Hi Kieran,
sites and sub-sites: yes
Content types: no. These should be deployed using custom features. Not using content deployment.
Cheers,
Stefan
Permalink
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
Permalink
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
Permalink
As a follow up to my article series about the content deployment and migration API here are some tips
Permalink
SharePoint Site vs. Web exports/imports and Custom Layout Pages
Permalink
Body: If you are deploying SharePoint you should take some time and read the following WSS/MOSS Content
Permalink
Can someone explain the difference between ExcludeChildren and IncludeDescendants?
Thanks
Permalink
Hi Timothy,
I have explained this in part 2.
Cheers,
Stefan
Permalink
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
Permalink
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
Permalink
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
Permalink
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
Permalink
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
Permalink
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
Permalink
how could we migrate list without list item?
How could we migrate list item version(list items are not files)?
Permalink
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
Permalink
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
Permalink
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
Permalink
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
Permalink
Hi Varun,
afaik that cannot be done when using the option to retains object identity.
Cheers,
Stefan
Permalink
Following are some of the things that I learned while doing the content deployment for one of my customers:
Permalink
Hello Stefan,
Just wanted to know "Does SPExport support multiple parallel jobs?" In other words is this class thread safe?
Permalink
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
Permalink
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.
Permalink
Hi Lili,
please open a support case with Microsoft to get this analyzed.
Cheers,
Stefan
Permalink
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
Permalink
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
Permalink
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
Permalink
Hi Anand,
this sounds like a known issue that was fixed in the February CU.
Cheers,
Stefan
Permalink
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
Permalink
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
Permalink
Hi Stefan,
Can we change any file(.aspx page) at the time of importing?
In which event we have to anchor our code?
Permalink
Not importing, at the time of exporting.
Permalink
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
Permalink
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
Permalink
Hi Intekhab,
this is by design if RetainObjectIdentity is false.
Setting this to true will avoid this problem.
Cheers,
Stefan
Permalink
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
Permalink
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
Permalink
SharePoint tiene un API para migrar contenido efectivo y poderoso.  Dentro del ensamblado Microsoft
Permalink
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
Permalink
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
Permalink
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
Permalink
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
Permalink
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
Permalink
Hi Sara,
yes, content types are transferred.
to retain the guid use RetainObjectIdentity as discussed in part 3.
Cheers,
Stefan
Permalink
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
Permalink
Hi Stefan,
Can I import a CMP file created on a 32 bit SharePoint server installation on a 64 bit SharePoint installation.
Thanks
Vedanshu
Permalink
Hi Vedanshu,
yes this is possible.
Cheers,
STefan
Permalink
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.
Permalink
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
Permalink
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.
Permalink
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
Permalink
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.
Permalink
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
Permalink
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!
Permalink
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
Permalink
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 ?
Permalink
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
Permalink
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
Permalink
Hi Mehul,
sounds to me as if you don’t have the latest hotfixes installed. A similar issue was in October CU.
Cheers,
Stefan
Permalink
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
Permalink
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
Permalink
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.
Permalink
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.
Permalink
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.
Permalink
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!
Permalink
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
Permalink
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?
Permalink
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
Permalink
Hi Pradeep,
there are no known limitations in this area.
The description sounds more like a db inconsistency.
Cheers,
Stefan