[Part 1 - Part 2 - Part 3 - Part 4 - Part 5 - Part 6 - Part 7]
Avoiding common problem
This can be one of the most frequently updated chapters of this article series as "common problems" can change over time. In addition I can only talk about common problems I have seen so far. But let get started.
Problem 1: Mixing deployments with and without retaining object identity
First of all: if possible you should avoid this! Importing with different settings for this property into the same database can lead to serious problems during future deployment and such databases will become hard to maintain.
Be aware that this also means that you should not use STSADM -o import against a database that should be used as the destination of a content deployment job!
STSADM -o import will not retain the object identity while content deployment does.
So why is there a problem when mixing imports with different RetainObjectIdentity settings?
The reason is that with RetainObjectIdentity enabled the imported object will have to be created with the same name and the same guid at the same location in the destination database as it was in the source database. If the item already exists it will be updated. If not it will be created.
Problems occur if there is an item with the same name but a different Guid in the destination database. This can happen if someone has authored on the destination server and created items with the same name but or if he imported content from the source server WITHOUT RetainObjectIdentity setting set to true.
In case that items with the same name but different GUID are allowed for the affected item you will end up with two items with the same name on the destination server. This will be the case (e.g.) for usual ListItems.
In case that items with the same name but different GUID are not allowed for the affected item the import will run into an exception similar to the one below and stop:
Failed to create the 'Pages' library. OriginalException: There can only be one instance of this list type in a web.
Failed to create the 'Pages' library. OriginalException: There can only be one instance of this list type in a web.
=> In order to avoid this problem you have to guarantee that content added to the destination database will not have any name/guid conflicts with the source database - even if new content is added to the source database in the future!
Problem 2: Running multiple imports without retaining object identity for updates of the same content
When doing an export and import without retaining the object identity on the destination server you can end up with duplicate items in lists as each import tries to create the same list item again with a different GUID. The import is not able to decide whether you would like to overwrite an existing item with the same name or if you would like to have multiple list items with the same name. Without retaining the object identity you will end up with multiple list items with potentially the same content. To force overwrite of list items you have to retain the object identity.
That means you cannot use STSADM -o export/import as a replacement for content deployment! If you need to do deploy content to a remote destination server without connectivity you need to write a custom tool that has retain object identity enabled rather than using STSADM -o import based on the code samples provided in Part 3 of this article series.
=> STSADM -o export and import should only be used if the content being imported does not already exist in the destination database and if the database will not be used as the destination database for content deployment (see Problem 1 above).
Problem 3: delete an item from the source site that belonged to the site definition and recreate it
This is a different flavor of the problem discussed as Problem 1.
During provisioning of a site items defined in the site definition template are added to the site. Problems can occur when changes are made to the provisioned items. Especially if the provisioned items are deleted and replaced with items with the same name. That approach will work well on a single server installation. But it will cause problems when using content deployment.
The reason is that during content deployment the site will be provisioned on the destination server using the site definition template. And this will also cause all items defined in this template to be created. When content deployment now tries to import the updated or replaced items there will be a conflict. You will end up with an exception similar to the one in Problem 1.
=> You should never modify or delete one of the items created through the site definition in your site. If the site definition does not suite your needs you should create a custom site definition that fits to your needs and use this instead to avoid the need to customize some of the provisioned items.
Problem 4: deploy from destination back to source
This is something that theoretically can be done but only if the source hasn't changed since it was last deployed to the destination. Otherwise the same issues as in Problem 1 can occur.
Also be aware that it will not be an incremental deployment - means you cannot just deploy the changes since you deployed from source to destination. The reason is that the timestamp information about what to deploy is stored with the deployment job. As this information only exists on the source system the first deployment from destination back to source will deploy everything! So the result would be the same as deploying into an empty site collection on the soruce system. And actually deploying into an empty site collection would be better to avoid problems in case that changes have been done on the source system.
Problem 5: deploy partial content without exporting the parent items
When deploying with retaining the object identity (as you can do with content deployment in the central admin) it is not possible to reparent items. Deployment with retaining the object identity requires that the identity of the object is the same on the destination server and the identity is defined by Id, Name and by the Url.
So the parent of each deployed object has to exist on the destination server in order to successfully import the package on the destination server. We have seen that customers are trying to export a specific subtree of the site without exporting the parents. E.g. only a specific variation label without the variation root.
If the parent of the exported objects does not exist on the importing site then the item cannot be imported and the deployment will fail.
=> Ensure that all parents of all content being exported exists on the destination server. => Or create a custom export tool that does not retain object identity and changes the parent during import as discussed in Part 3 but be aware about the limitations discussed as Problem 2.
Problem 6: deploy partial content with references outside the selected scope
This is similar to Problem 5 except that we assume that the parent objects of the selected object exists in the destination database. In this situation you might assume that no problems should occur. That is not correct. When exporting items in a subtree per default all referenced objects (like images or documents) will be exported as well. Even if these objects are outside the selected scope. In this situation the export package will contain objects which might not have a parent in the destination database.
If the parent of this image or document does not exist on the importing site then the item cannot be imported and the deployment will fail.
=> Ensure that authors do not use resources from other parts of the site collection which is not being exported.=> Or create a custom export tool that uses the ExcludeDependencies to exclude objects outside the selected export scope. See Part 2 for more details.
I haven't tried everything in your list but for the problem I would try to export the rootweb together with the forms library and all it's content on the initial deployment. This should avoid the conflicts.
this is what we tried last night and yes this seems to avoid the issue.
Another potential solution would be that we delete all lists and libraries on the target site after the first import of the root web without descendands.
But we assume that there was a reason for MS to have two different object types (site vs.web)
Which content related directly to the site collection won’t be replicated when using the root web object instead of the site object as export object? And if there is a difference, is there a way to replicate this delta without descendants of the site collection by using the PRIME API?
Are there any plans from MS to adjust the API that you could use the site object without descendants?
if you have a look in the manifest file of the export you will see that there are no specific things exported with the SPSite object.
This object is a container for all the included hierarchically organized SPWeb objects inside the site collection.
There are currently no plans to adjust the API.
Markus wrote: "By only adding one list with IncludeDescendants=All the PRIME API also deployed the items of added lists with IncludeDescendants=None."
At the moment we handle this by doing one export/import with lists where we don't want to have the descendants included and one export with lists where we want to have the descendants included.
Are there any plans from MS to adjust the API so that you could mix up lists with different IncludeDescendants settings in one export/import?
if it is indeed as Markus wrote, then it sounds like a potential problem in the API. You should open a support case to get this analyzed. Without a support case it will not be investigated and/or fixed.
There is more info on Content Deployment issues in earlier blog entries here. But the best information
I have successfuly backed up and restored a SharePoint web site from one server to another, but when try to access the new site it gives me: Error - File Not Found. After doing invistigation to find the cause, i found out that it is the custom master page i am using in the site so if i change the sote master page to any existing one, the site will work. What could be the reason behind this??? i have made sure that the custom master page exists in the new site with the same size as the original one, also iam using the publishing feature.... Any clue regarding this issue????
backup/restore is not supported between different farms as it will not adjust the absolute URLs inside the database.
You have to use export/import.
Interesting series of articles. I only wish the MSDN was as documented on "real world scenarios" to help the rest of us.
Have you read the post over on SharePointBlogs.com about moving documents with version history (http://www.sharepointblogs.com/dez/archive/2007/11/30/moving-copying-documents-between-libraries-with-metadata-including-version-history.aspx)?
It seems that there may be several approaches to migrating content depending on whether you have MOSS or just WSS...it was an interesting read.
I had a look at the article it is a nice approach to do things manually - and maybe have more control if required (e.g. if specific versions should be skipped or not).
Regarding my point of using backup/restore to deply a site from one server to another, i have followed when you told me to use export/import instead. Export was done successfully, then i created empty template web site and a new site collection then when i try to import, i get this error:
FatalError: Could not find Feature NewSearchBox.
at Microsoft.SharePoint.Deployment.ImportRequirementsManager.VerifyFeatureDefinition(SPRequirementObject reqObj)
at Microsoft.SharePoint.Deployment.ImportRequirementsManager.Validate(SPRequirementObject reqObj)
Do you have any clue what could be the reason behind this error??
Hi Stefan, plz ignore my last query.
Related to my previous post, while running the import operation, i get this error:
FatalError: User or group 23 cannot be resolved.
Any idea why this error is happening??
In order to bypass the last error i got, i tried to do import without inheriting the security from the orginal site, then import worked fine, but when i try to run the site it's again giving me the same error i used to have when using the backup/restore option which is: File Not Found.
So at the end, whether i used backup/restore or export/import, at the end its giving the same error.
Any advice you can give me hear, i have invested long time just to import/export a sharepoint site from one server to another server but nooooooo hope.
I don't know why the process looks that complicated, for sure i am not the first one to do such thing!! I appreciate your help.
in chronological sequence: The custom feature NewSearchBox is not installed on the destination farm. You need to install all features on the destination farm before doing an import. See Part 6 for more details.