I am trying to export a subsite from a site collection and import it into a new subsite, from
(This is a root level site collection)
http://web/subsite1 to http://web/subsite2
but I keep getting an error when doing
PS C:\exportdata> Import-SPWeb http://web/subsite2 -Path C:\export
I get the following, I created a custom list called List1.
[8/7/2012 10:11:47 AM] [List] [List1] Progress: Importing [8/7/2012 10:11:47 AM] [List] [List1] ExtendedVerbose: Creating [8/7/2012 10:11:48 AM] [List] [List1] Error: An unexpected error has occurred. [8/7/2012 10:11:48 AM] [List] [List1] Debug: at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) at Microsoft.SharePoint.Library.SPRequest.CreateListOnImport(String bstrUrl, Guid& pguidListId, String bstrTitle, String bstrDescription, Int32 lTemplateID, String bstrFeatureId, Guid guidRootFolderId, Int64 llFlags, Int32 iVersion, Int32 iAuthor, String bstrFields, String bstrContentTypes, String bstrImageUrl, String bstrEventSinkAssembly, String bstrEventSinkClass, String bstrEventSinkData, Guid guidDocTemplateId, String bstrViews, String bstrForms, Boolean bCompressedSchema, DateTime dtTimeCreated) at Microsoft.SharePoint.Deployment.ListSerializer.CreateList(SPWeb parentWeb, Dictionary`2 listMetaData, Boolean usingPublicSchema) at Microsoft.SharePoint.Deployment.ListSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector) at Microsoft.SharePoint.Deployment.XmlFormatter.CallSetObjectData(Object obj, SerializationInfo objectData, ISerializationSurrogate surrogate, ISurrogateSelector selector)
I remember having a problem that felt like this before when I was trying to do site collection imports and the cause was I wasn't using a "Select template later" template but for subsites I don't know what to do.
I am creating the subsite as the same template as the exported site before I try to do the import.
Are you trying to import the backed up subsite into the same Site Collection it was originally in (but with a new URL)? Did you remove the original subsite first?
Also, have you tried restoring it to another Site Collection just to test the backup out? You should not have to use the -Force switch when doing a restore...
Hope this helps,
Troy Lanphier -- MCT/MCSE/MCITP SharePoint Server 2010 Administration -- Author: Microsoft SharePoint Foundation 2010 Inside Out -- http://blog.sharepointcookbook.com
Jason they are both subsite under the same site collection.
Troy I did try to import the site back into the same site collection without removing the original (Using a new url).
I moved it to another dev server and the import worked fine. The initial server I was trying to do this on was a Windows 7 box and it seems to always produce unexpected results.