.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Import-SPWeb into non-existing site?

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :SharePoint

Trying out the Import/Export-SPWeb PowerShell CmdLets instead of stsadm -o export/import.


Export-SPWeb works great to export a site into a .cmp file, but when I try to import it using Import-SPWeb:

    Import-SPWeb -Identity http://myserver/nonexisting -Path d:\export\site.cmp

I'm getting an error message that it can't open the SPWeb. Non surprising since it doesn't exist - that's the whole point of an import.


With stsadm -o import I have no issues, it just creates the /nonexisting site with the proper template and everything.


Am I overlooking something, or is Import-SPWeb indeed inferior to the depreciated stsadm?

View Complete Post

More Related Resource Links

XML Schemas: Take Advantage of Existing External XML Schemas with a Custom Import Framework in ASP.N


Over the years, many industry-standard XML schemas and dialects have been developed. These industry-specific schemas embrace the original purpose of XML and are extremely valuable in promoting and supporting B2B interaction. Unfortunately, the ASP.NET Web Services runtime does not allow developers to directly reference external schemas from within their XML Web Services interface (the WSDL file). This article builds an external schema framework as an extension to the ASP.NET Web Services runtime to enable you to reference external schemas within your XML Web Service interface.

Scott Short

MSDN Magazine December 2002

Question on using variations on an existing site


I've been using MOSS 2007 for my company's CMS system for the last 2 years or so. Recently, the marketing department has asked us to include the option for multilingual support so naturally, I looked to using variations to accomplish this, however, the site was setup without variations since this was "definitely" not a requirement back when we setup the site.

My problem is when I enable variations, it seems to create new sites off of the root (e.g. English, Spanish, French), however,  it isn't copying anything from the Root site that already exists or any of it's subsites or pages. Is there any to keep my existing site content intact and still use variations, including all of the update features?

Thanks in advance

Is it. Is it really?

Alternate languages - change on existing site

Hello. I need a help. In my template, when i choose in Site Actions -> Alternate languages and then on System account choose "Select Display Language". Work for RIBBON row and for all fields. But not work for a Quick Launch Menu. I have a .resx for Slovenian and English. I think i need some web update event receiver, but i do not find. If i use a template of SharePoint 2010 it's work also  Quick Launch Menu.

Is it possible to configure an existing sub site as variation source label in 2010?

Hi, I am trying to configure variations on an existing site. For example, I already have a site collection and a sub site "en-us" that has all the content. Would it be possible to configure this existing "en-us" as my variation source site? If not possible, can anyone suggest me any work-around? This is very critical and hopefully there is a way to achieve this without having to move all the content from "en-us" to my top level site, create variation labels with different names, and then delete the content from top-level site. Please suggest. Thanks, Karthik    

Issue with Picture Library Slideshow Web Part after export/import of site collection (SP2010)


I recently exported/imported an SP2010 site collection from Dev to Prod. The site collection had about 90 sites, which were all driven from a site template. Once the export/import had taken place, I created an additional 15 sites (in Prod), using the original site template that was created in the Dev environment. Everything seemed to be working just fine, but I found an issue with the Picture Library Slideshow Web Parts (PLSWP) on all the sites that were created in Prod. Basically, I have a Picture Library, and any pictures added to this library show up in the PLSWP. The original 80 site's PLSWP works fine, but the new 15 sites will not show the pictures through the PLSWP (the viewer just shows up blank). Here is the difference in the html output of the picture viewer:

 PLSWP from Dev:

 <a target="_blank" href="http://forefronttest/realestate/RE/West/HOU/3560/Project%20Pictures/test.jpg" id="MSOPictureLibrarySlideshowWebPart_ctl00_m_g_28b22a62_6d8

how to create a site definition from existing site in sharepoint

Hi any one please help me how to create a site definition from existing site in sharepoint. It's very urgent

Thanx in Advanced



How to associate STP file to an existing site in same farm.




single farm


there are 2 web-applications: web-app1, web-app2.


Each webapp has one site collection. that is 


webapp1 has site-collect1


webapp2 has site-collect2


Now for some reason I want to copy site-collect2 to webapp1 as site-collect1.


content-db doesn't work because of database ID issue.


I am trying to use 'save as template' from site-collect2 and can get STP file but how do I assocaite this STP file to site-collect1. I am looking for any STSADM commands or source code that does this. Here also I wanted to create site-template with 'data' but it is giving me error. I will check this later. 

thanks for reading.please suggest.

Site export/import not getting all docs in a library

I am using stsadm to move a site form one site collection to another and for some reason a doc library in the restored site is missing docs. Any thoughts?

Site Definition Import 2007 - 2010 - navbarlink problem



I have a problem to import a site definition from 2007 to 2010.

In this site definition i have navbar and navbarlink.

In 2007 i could use Resources in navbarlink Url like this :

<NavBar Name="$Resources:CFS,RootSiteDef_Nav_Request;" Url="$Resources:core,lists_Folder;/$Resources:CFS,RootSiteDef_Nav_Request;/" ID="1005">
   <NavBarLink Name="$Resources:CFS,RootSiteDef_Nav_Request_ByStatus;" Url

Adding .aspx page to existing web site



I have a running ASP.NET web site. There is following problem with one of the forms:

One part of submitted data is added to database after "submit" is clicked. (to "table1")

Another part is lost (not added to "table2", and no files uploaded)

I have no source code of that project.

So, because I cant edit existing page, I came to a decision to add new .aspx page to a running application with same functions as existing one.

How can I do that? Or maybe you can recommend some other solution.

Thanks, Alex. 

import-spweb changes some values (create date, modified...)


all my Imported items (export-spweb - >import-spweb) have today's date now.
And the creater is now mydomain\administrator.

Can I fix this somewhere ?
Maybe in a SQL table ?


Error opening site using SPSite and SPWeb instances using VS 2010, Win Server 2008 R2


Hi I am trying to open my site using SPSite and SPWeb instances and getting an error message as below-

The Web application at http://url could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

  CODE is -



                    SPSite siteCOll = new SPSite(siteURL);

                    SPWeb oWeb = siteCOll.OpenWeb("url");



I can access site using browser perfectly.

I am running VS as administrator.

I have done permission checking aswell.


please help!





How to apply a custom master page to all the existing site collections, sub sites in sharepoint 2010



my custom branding master page is applying to the newly created site collection or sub sites using feature stapling.

but my intension is already created site collections and sub sites, here i am not able to apply custom master page to site collections and sub sites.

pls help me. i need to complete this task today EOD.

Creating a feature that will recreate a existing site with all it's subsite content


i have a site saye http://intranet

under that site i have http://intranet/eng


now i have to create a Feature that once activated will recreate the same site http://intranet and its subsites http://intranet/eng

http://intranet/IT with all its contents

in another site collection in the same FARM.

Any suggestions that will help me here 

Extending an existing site definintion


Hi All,

I wanted to know if there is a way for me to extend an existing site definition instead of starting everything from scratch. I have an existing site definition that works well for our needs but i need to design a variant to this one which differs only slightly. So, instead of creating all the xml files, feature receivers etc.. i want to extend the existing one and make changes.


Import-SPWeb, List does not exist error

I have a strange problem with custom lists in an imported site.
After exporting the site in Central Admin by clicking "Export a site or list" and importing it with "Import-SPWeb" (on a different farm), I cannot read or create new items in custom lists in the imported site. However, by code, i.e. using PowerShell or custom Web Parts, I can read items in the list without any problems.

If I click on any item in a list however, I get an error saying "List does not exist. The page you selected contains a list that does not exist.  It may have been deleted by another user."

I guess it has something to do with permissions, since I get an "Access denied" error when trying to create new items through the browser. The permissions settings seem fine in the browser though...

EDIT: This seems to occur only on lists where I have created custom list forms, like Disp and Edit pages. I guess it has something to do with these files. Are any one else having the same problem?

EDIT 2: Correction, this occurs on every list.

Creating Site Collection in Existing Content Database

Hi All,

I'm trying to create a site collection in a existing content database. I haven't found a method in Sharepoint object model to perform such a action. There is an option to create a site collection in a new database using the following command:
SPSiteCollection.Add(url, siteDescription, siteDescription, 1033, siteTemplate,
                                                                siteCollPrimaryAdmin.LoginName, siteCollPrimaryAdmin.Name, siteCollPrimaryAdmin.Email,
                                                                siteCollSecondaryAdmin.LoginName, siteCollSecondaryAdmin.Name, siteCollSecondaryAdmin.Email,
                                                                strSQLServerName, siteContentDBName, null, null);

Is there a different object to do this creation on existing database? Any ideas to approach this problem will be greatly appreciated



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend