In the past I have seen the following problem a couple of times: a customer creates a backup of a content database on one server farm (e.g. using STSADM -o backup or a DB backup in SQL) and restores the backup on a different farm and attaches the content database to a web application.
After this operation is done several operations (like variations and content deployment) fail to work with the following exception:
System.ArgumentException. Value does not fall within the expected range. at Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder) at Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder) at Microsoft.SharePoint.SPWeb.GetMetadataForUrl(String relUrl, Int32 mondoProcHint, Guid& listId, Int32& itemId, Int32& typeOfObject, Object& fileOrFolder) at Microsoft.SharePoint.SPWeb.GetFileOrFolderObject(String strUrl) at Microsoft.SharePoint.Publishing.CommonUtilities.GetFileFromUrl(String url, SPWeb web)...
The reason for this problem is that backup/restore does not adjust the references from the publishing page objects in the Pages library to their Page Layouts. These URLs are sometimes stored as absolute URLs including the server name. And this server name is the server name of the old server farm which cannot be resolved on the new farm.
Be aware that backup/restore of MOSS content databases between server farms are not fully supported! Official documentation of this support limitation is currently in the works. The supported way to transfer content between server farms is to use STSADM -o export/import or content deployment. Backup/restore is only supported for the same server farm.
In case that you have run into the above problem you have two options:
I have written a tool to automatically perform this fix: FixPageLayout
[Update from 2009-05-01] Microsoft has now released a hotfix to support backup/restore between different farms for publishing sites. See here for details.
It doesn’t give you much more details than the following message: "An error was encountered performing
For "file not found" error check for search service. May be error with search services. have you restored to different server? The native backup nad restore is for restoring to the same machine.
SharePoint Diagnostics (SPDiag) Tool v1.0 for SharePoint Products and Technologies The real power of
hi Stefan, I could not locate any information on product docs regarding your statement "... Official documentation of this support limitation is currently in the works..." Is backup/restore not fully supported between farms as of now? Thank you for your great article!
Hi BT,
as outlined in the blog article: currently not supported for site collection using the publishing feature.
Cheers,
Stefan
Hallo Stefan,
can you please help me with a quick step by step copying the site collection from one fram to another?
I have A new clean MOSS environment, with a site collection (collaboration site).
And I have a very well used old Moss environment, both Moss enterprise edt.
I want to copy all the data from the old site collection to the new one. The size of the old site is approx 50GB... Can I still use the stsadm tool to do a export / import?
What is the fileextension for the file?
Thanks
//Esteban
Hi Esteban,
on target you need to have an empty site collection - so no template assigned and not a site with collaboration template.
Best is to create the target site collection using STSADM:
STSADM -o createsite -url http://url-to-target-sitecollection -ownerlogin ... -owneremail ...
Then export the site collection using STSADM:
stsadm -o export -url http://url-to-source-sitecollection -filename myexportfile.cmp
Then import the packate into the empty target site collection:
stsadm -o import -url http://url-to-source-sitecollection -filename myexportfile.cmp
Thats it.
As I discussed in an earlier article backup/restore between farms for publishing sites was unsupported
Hi Stefan,
I'm a little confused. Here's the way I would normally backup/restore to a different farm:
* Create the empty site collection on the destination server
* Using setsitelock, preparetomove and deletecontentdb commands, go on to detach and reattach the content database on the target server by moving the .mdf and.ldf files.
* Use the addcontentdb command
* Reset IIS and perform a full crawl
Am I correct in presuming that this will not cause the error you mention in the blog?
Rgds,
Anthony :-)
Hi Anthony,
you would get the same problems. this method will not change the page layout URLs in the publishing pages.
In addition preparetomove should not be used anymore.
See here for details:
http://blogs.msdn.com/toddca/archive/2009/01/30/preparetomove-away-from-running-this-command.aspx
Stefan,
Thanks for getting back - that helps. What I am trying to do in my situation is to move the production site collection to a test VM to try applying the new SP2. What would you suggest as a set of recommended steps for someone attempting this? (I'm sure everyone will want to test the SP2 install first before installing it on production boxes).
Just to test the SP2 installation you can use backup/restore.
You just need to be aware that requests to the site might cause exception if you use different host name in the URL than on the source system.
To fix these problems you can use the tool listed above.