none
Export-SPWeb: Cannot find an SPWeb object with Id or Url RRS feed

  • Question

  • Hi everyone

    I have a bunch of content to move within our existing SharePoint 2010 portal that has been migrated from 2007 some months ago. It's mostly moving lists and libraries (and their items) from one site collection to another one.

    Since it's so many lists etc. that I need to move and I already have their URL's ready to be copy/pasted, I plan on doing the Export and Import through PowerShell, hoping it will save me some time. Well, so much for that... I can't seem to get the export-spweb CMD to work! I'm using the following command:

    export-spweb -identity http://intranet/units/unitname -itemurl /units/unitname/lists/listname -path e:\temp\exportlist1.cmp

    The full URL of the list I'm trying to export is http://intranet/units/unitname/lists/listname/AllItems.aspx

    I keep getting the following error message, which imho is very generic:

    Export-SPWeb: Cannot find an SPWeb object with Id or Url ...

    Is there anywhere I can find more details on the error?

    Please find the full error message at the bottom of this post. Any help is greatly appreciated. I have tried the various command listed in this post without any success.

    Could this be a permission issue? My account has been added to the farm administrator's group in Central Administration and I also have the SharePoint_Shell_Access permission on the SharePoint Config DB. Is there anything I'm missing?

    Cheers

    Marc 

    *******************

    Export-SPWeb : Cannot find an SPWeb object with Id or Url : http://intranet/units/unitname.
    At line:1 char:13 + export-spweb <<<<  -identity http://intranet/units/unitname -itemurl /units/unitname/listname -path e:\temp\exportlist1.cmp
        + CategoryInfo          : InvalidData: (Microsoft.Share...CmdletExportWeb:   SPCmdletExportWeb) [Export-SPWeb], SPCmdletPipeBindException    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletExportWeb

     

    Tuesday, September 6, 2011 5:18 PM

Answers

  • Hi

    I was able to run the export CMD successfully after I was given db_owner permissions on the respective Content DB.

    export-spweb -id http://intranet/units/marketing -itemurl /units/marketing/Lists/ListName -path e:\temp\exportfile1.cmp -IncludeUserSecurity

    That seemed to be the only problem! Thanks for your help.

    Cheers

    Marc


    Friday, September 16, 2011 7:03 AM

All replies

  • Try 
    $web = get-spweb http://intranet/units/unitname
    in the management shell and then
    echo $web
    It may be that your server does not recognize the url and requires FQDN or you have AAM
    AK
    Tuesday, September 6, 2011 6:09 PM
  • Hi AbedKhooli,

    Thank you for your reply. AAM should not be an issue as the server's host name actually is "intranet".

    I tried running the command suggest, which returned an error. However, I believe this is because http://intranet/units/marketing is not a web (Site) but a site (Site Collection). After changing the CMD to $web = get-spsite http://intranet/units/marketing the echo command returned the proper site.

    How should I proceed now? I'm still trying to export a list within this site, which is I believe the top level site of the site collection. Could this be the root of my problem? Unfortunately, backing up the entire site collection will not help as I only need to move certain content (mainly custom lists) from one site collection to another one.

    Thanks for your help!

    Marc

     

    Sunday, September 11, 2011 8:12 AM
  • Hi ,

    check the following thread

    http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/6f94bb3f-7560-407f-a5b8-1e341571d26d


    Regards, Fadi Abdulwahab. http://sqlgoogler.blogspot.com/ Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you
    Sunday, September 11, 2011 8:18 AM
  • > export-spweb -identity http://intranet/units/unitname

    Are you running this command from a PowerShell running on one of the SharePoint servers? If not, are you using PowerShell remoting to access the remote SharePoint server?

    > Could this be a permission issue?

    Yes.

    Here is a good summary: http://sharepoint.microsoft.com/Blogs/zach/Lists/Posts/Post.aspx?ID=56

    From that article: "You’ll notice that the commands allow you to designate a specific database, this is because the “Shell Admin” role by default only gives the user access to the Configuration Database; the shell admin must be given access to each individual service and content database they are “allowed to manipulate” (i.e.: to delete a content database, the user must be a shell admin on that database)."

    Also google/bing "sharepoint powershell permissions"

     


    Mike Smith TechTrainingNotes.blogspot.com
    Sunday, September 11, 2011 8:24 PM
  • Thanks for your posts. I will have a look at the articles you suggested.

    @Mike: I'm trying to run this command directly from the SharePoint 2010 server. There are no other servers in this farm at this point and I'm not trying to execute the command remotely.

    I will post any progress...

    Marc

    Monday, September 12, 2011 1:50 PM
  • Hi

    I was able to run the export CMD successfully after I was given db_owner permissions on the respective Content DB.

    export-spweb -id http://intranet/units/marketing -itemurl /units/marketing/Lists/ListName -path e:\temp\exportfile1.cmp -IncludeUserSecurity

    That seemed to be the only problem! Thanks for your help.

    Cheers

    Marc


    Friday, September 16, 2011 7:03 AM
  • Just wanted to say that I ran into the same problem attempting export. This solution solved my problem! Once I got myself added with permissions on the database, I no longer ran into the export-spweb error.

    Thanks very much for posting your solution, and also for the syntax of the command you were using, it helped me out a lot.

    I only with the error message itself would have been clearer about needing those database permissions.


    Tai Yee [MS] This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, September 6, 2012 5:40 PM