I have a content database to a sql server which is used by Sharepoint 2010.
Using central administration, I am able to browse the sites and export the sites.
I worte a program to use the Sharepoint APIs to do the same but I get the following error. I am filling the settings structure and calling export.run.
The url I am sending for the export
//vinay10:2434/sites/99156/test112/111
vinay10:2434 is the central admin webapp.
SPExportObject exportObject = new SPExportObject();
exportObject.Id = id;
exportObject.Type = SPDeploymentObjectType.Web;
exportObject.IncludeDescendants = SPIncludeDescendants.Content;
settings.UnattachedContentDatabase = contentdatabase;settings.ExportObjects.Add(exportObject);SPExport export = new SPExport(settings);export.Run();
And using the central admin too it shows similar values --- //vinay10:2434/sites/99156 is the site collection
sites/99156/test112/111 is the site.
I attached the content database also before calling export.run. But I get the following error. Can any one tell me what I am missing?
System.IO.FileNotFoundException: sites/99156/temp2/111 at Microsoft.SharePoint.Administration.SPUnattachedDatabaseUtility.LookupIdContentDatabase(SPContentDatabase database, String serverRelativeUrl) at Microsoft.SharePoint.SPSite..ctor(SPContentDatabase contentDatabase, Uri requestUri, Boolean isHostHeader) at Microsoft.SharePoint.Deployment.SPExport.InitializeExport()