A customer wanted to archive Share point sites when they were finished with them to a file to keep the share point site clean.
After consultation it was decided that exporting the site was the best option.
Now it has time for one of the sites to be imported back in. So a site was created and the default team site was used as the base template. (As I was unaware of what site was meant to be used, and it looked like the team site)
After running the import command it failed with the following error.
FatalError: Cannot import site. The exported site is based on the template STS#0 but the destination site is based on the template SGS#0. You can import sites only into sites that are based on same template as the exported site.
So how was I to find out what site template should have been used. To find out the template I ran the following command
stsadm.exe -o enumallwebs
Which gave me an output similar to (Plus a whole lot more)
<Site Id="f683522a-XXXX-4d1d-8707-dc06ebXXXXXX" OwnerLogin="XXXXX\sharepoint" InSiteMap="True"> <Webs Count="1"> <Web Id="66eaa414-XXXX-4a7f-XXXX-3a3fd3a71f3c" Url="/XXXXX/library" LanguageId="1033" TemplateName="SGS#0" TemplateId="15" /> </Webs> </Site>
From this output I can see that the Library site has used the same template file of SGS#0
So I saved that library site as a template, exported from the solutions gallery.
Imported into the site collection solutions gallery and created the restoration site using the new template.
Then I started the import again using the new site. This time it failed with
Import-SPWeb : A list, survey, discussion board, or document library with the specified title already exists in this Web site. Please choose another title.
So I opened Share Point Designer on the new site and removed as many lists and document library’s as possible (Some were not able to be deleted) and then reran the following command.
Import-SPWeb -Identity “http://sharepoint/xxx/construction/restored site” -path \\sharepoint\SPBackups\exported site.cmp –IncludeUserSecurity –UpdateVersions Overwrite -Force
which completed successfully. The site was now restored.