Answered by:
Export/Import SPWeb on site collection Powershell

Question
-
I want toexport and import spweb. SpWeb on target site collection doesnt exist, how can I do this?
i try to use:
Export-SPWeb -Identity "http://dev/sites/XXFrom/services/ServiceFrom2" -Path "C:\Site.cmp" -IncludeVersions All -Force
Import-SPWeb -Identity "http://dev/sites/XXTo/services/ServiceFrom2" -Path "C:\Site.cmp"
I have error:
Import-SPWeb : Cannot find an SPWeb object with Id or Url : http://dev/sites/XXTo/services/ServiceFrom2.
At line:1 char:13
i also try export on higher level use:
Export-SPWeb -Identity "http://dev/sites/XXFrom/services" -ItemUrl "ServiceFrom2" -Path "C:\S
ite.cmp" -IncludeVersions All -Forcegives me error:
Export-SPWeb :
At line:1 char:13
+ Export-SPWeb <<<< -Identity "http://dev/sites/XXFrom/services" -I
temUrl "ServiceFrom2" -Path "C:\Site.cmp" -I
ncludeVersions All -Force
+ CategoryInfo : InvalidData: (Microsoft.Share...CmdletExportWeb:
SPCmdletExportWeb) [Export-SPWeb], SPException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletExportWe
bOther object like library Images export properly
How should i do this without create manualy sp on destination site collection ?
- Edited by Jacues87 Friday, February 27, 2015 12:13 PM add
Friday, February 27, 2015 12:06 PM
Answers
-
Hello, you should create new site using new-SPWeb command.
The steps should be:# 1) Backup Export-spweb "http://XXXX/SiteFrom” -path C:\sitieFrom.cmp # 2) Create New Site: new-spweb "http://XXXX/SiteTo" -name "SiteTo" # 3) Restore: Import-spweb “http://XXXX/SiteTo” -path C:\sitieFrom.cmp
Hope this helps. Regards
- Proposed as answer by taylor.l Friday, February 27, 2015 12:22 PM
- Marked as answer by Dennis Guo Saturday, March 7, 2015 1:51 PM
Friday, February 27, 2015 12:19 PM -
Create a site collection first, then restore the sp-web. That can be done through the GUI or by using
New-SPSite
- Proposed as answer by taylor.l Friday, February 27, 2015 12:22 PM
- Marked as answer by Dennis Guo Saturday, March 7, 2015 1:52 PM
Friday, February 27, 2015 12:09 PM
All replies
-
Create a site collection first, then restore the sp-web. That can be done through the GUI or by using
New-SPSite
- Proposed as answer by taylor.l Friday, February 27, 2015 12:22 PM
- Marked as answer by Dennis Guo Saturday, March 7, 2015 1:52 PM
Friday, February 27, 2015 12:09 PM -
Hi,
Destination site collection http://dev/sites/XXTo exist and also subsite exist http://dev/sites/XXTo/services. I want to import subsite "ServiceFrom2" to this subsite: http://dev/sites/XXTo/services
- Edited by Jacues87 Friday, February 27, 2015 12:17 PM
Friday, February 27, 2015 12:15 PM -
Hello, you should create new site using new-SPWeb command.
The steps should be:# 1) Backup Export-spweb "http://XXXX/SiteFrom” -path C:\sitieFrom.cmp # 2) Create New Site: new-spweb "http://XXXX/SiteTo" -name "SiteTo" # 3) Restore: Import-spweb “http://XXXX/SiteTo” -path C:\sitieFrom.cmp
Hope this helps. Regards
- Proposed as answer by taylor.l Friday, February 27, 2015 12:22 PM
- Marked as answer by Dennis Guo Saturday, March 7, 2015 1:51 PM
Friday, February 27, 2015 12:19 PM -
Hello,
I have a little confusion, first im facing the same issue which Jacues87 has reported, where i have exported a SharePoint list (SPWEB) from a sub-site and i want to import it into another sub-site in different farm and site collection.
if i will follow your instruction,
what i should do after creating new site collection and then importing the SharePoint list into that new site collection, still i need to import the list into the subsite i have faced the problem with.
please advice.
Thank you
Karim El Zarka, MCTS Sharepoint 2010 , MCITP SharePoint Administrator 2010 Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Mark As Answer
Thursday, August 13, 2015 12:20 PM