locked
stsadm command failing with 'command line error' RRS feed

  • Question

  • We're trying to export our site from our production server and import it into our staging server so we can run some tests on the site.  When I try to export the site using the command below, I recieve 'Command line error' but I can't tell what it is complaining about.  I've done the following

    1.  Removed default.aspx from the url
    2.  pointed to a shared folder  instead fo the physical path
    3.  logged out and logged in using the services account we use with the SSP.
    4.  Tried the same command with backup instead of export.

    If someone sees the error in this command please let me know.

    Thanks.

    Jim

    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN>Stsa
    dm -o export -url http://mycompany/TechnicalSupportCenter/default.aspx -filename d
    :\tsc_site.cmp

    Command line error.


    Usage:
               stsadm.exe -o <operation> [<parameters>]
               stsadm.exe -help [<operation>]

    Operations:

    • Moved by Mike Walsh FIN Thursday, April 23, 2009 3:19 AM admin stsadm
    Wednesday, April 22, 2009 8:43 PM

Answers

  • Hi Jim,

     

    I suppose you copy a stsadm command (from a web site or Word doc or something) and paste it into the command window.

    I personally came across the problem for several times. Here is the cause of the issue for your reference:

     

    If you copy these commands from the web page, sometimes there is a double dash character (like stsadm --o export) instead of a single dash. When those commands are pasted into a text only program like the command prompt or Notepad, they appear to be a single dash, but they are still interpreted as a double dash. This is why the command fails even though it looks perfect.

     

    Here are two workarounds for your information:

    1.    Type the commands in manually instead of copying and pasting them from the web page.

    2.    Copy them into WordPad, change all the double dashes to single and then copy them into the command prompt.

     

    By the way, you should specify the site / site collection URL in the -URL parameter like: *http://mycompany/TechnicalSupportCenter/*.

    If you specific the wrong URL, the error message should be *The URL provided is invalid. Only valid URLs that are site collections or sites are allowed to be exported using stsadm.exe*.

     

    Hope the information can be helpful.

    -lambert


    Lambert Qin | Microsoft Online Support Engineer
    How to ask a question in the forum (http://support.microsoft.com/kb/555375)
    Posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by schnauzer Friday, April 24, 2009 3:32 PM
    Friday, April 24, 2009 10:45 AM

All replies

  • Hi,

    The user who you are running as, do they have security permission to export (site collection admin) the site and to the D:\ drive (Read/Write)?

    I would also recommend using the url of http://MyCompany/TechnicalSupportCenter (drop the /default.aspx).

    Are you running this command locally on the server in which SharePoint is installed? or doing it on a remote machine?

    Kind Regards,

    Daniel


    Blog: http://www.danielbrown.id.au/ Adelaide SharePoint User Group: http://www.aspug.org.au
    Thursday, April 23, 2009 12:54 AM
  • Moving to Admin (stsadm and export/import ...)
    WSS FAQ sites: WSS 2.0: http://wssv2faq.mindsharp.com WSS 3.0 and MOSS 2007: http://wssv3faq.mindsharp.com
    Total list of WSS 3.0 and MOSS 2007 Books (including foreign language titles) http://wssv3faq.mindsharp.com/Lists/v3%20WSS%20FAQ/V%20Books.aspx
    Thursday, April 23, 2009 3:18 AM
  • Could you try this:
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN>Stsa
    dm -o export -url http://mycompany/TechnicalSupportCenter/default.aspx -filename tsc_site.cmp

    (without the d:\)
    My blog on WSS / MOSS development is found at http://jebass.blogspot.com
    Thursday, April 23, 2009 7:26 AM
  • Hi Jim,

     

    I suppose you copy a stsadm command (from a web site or Word doc or something) and paste it into the command window.

    I personally came across the problem for several times. Here is the cause of the issue for your reference:

     

    If you copy these commands from the web page, sometimes there is a double dash character (like stsadm --o export) instead of a single dash. When those commands are pasted into a text only program like the command prompt or Notepad, they appear to be a single dash, but they are still interpreted as a double dash. This is why the command fails even though it looks perfect.

     

    Here are two workarounds for your information:

    1.    Type the commands in manually instead of copying and pasting them from the web page.

    2.    Copy them into WordPad, change all the double dashes to single and then copy them into the command prompt.

     

    By the way, you should specify the site / site collection URL in the -URL parameter like: *http://mycompany/TechnicalSupportCenter/*.

    If you specific the wrong URL, the error message should be *The URL provided is invalid. Only valid URLs that are site collections or sites are allowed to be exported using stsadm.exe*.

     

    Hope the information can be helpful.

    -lambert


    Lambert Qin | Microsoft Online Support Engineer
    How to ask a question in the forum (http://support.microsoft.com/kb/555375)
    Posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by schnauzer Friday, April 24, 2009 3:32 PM
    Friday, April 24, 2009 10:45 AM
  • Thanks.  The double dash must have been the issue because I was copying the command from a document I had put together to verify I had the correct format.  After I typed the command manually, it worked without issue.  I was scratching my head about the root cause but your explantion saves me so extra gray hair.

    Friday, April 24, 2009 3:32 PM
  • that double dash had me going a few months ago and I ran into the same problem today and forgot all about that!  I copied and pasted from the microsoft stsadm export and import page...

    Wednesday, June 3, 2009 5:29 PM
  • Thanks for the post , I was getting the same error despite everything was currect and was not able to find the root cause. This was very helpfull :)
    Friday, October 16, 2009 3:25 AM
  • Hi guys,

    I have the same issue and follow your comments but still I got the error it says the URL is not vaild. This is what I did:

    bin>stsadm.exe -o export -url http://myservername/SubSite/Lists/My%20List%20Name/myPage.aspx -filename Export.cmo -versions 4 -cabsize 1000

    I even try with url 'http://myservername/SubSite/Lists/My%20List%20Name/myPage.aspx' still says invalid url. I wonder if you can help?am i missing something here...

    Any advice greatly apprciated.

    BalaiP

    Thursday, October 4, 2012 7:00 PM
  • Did you type the command or did you cut and paste from another document?  I had to type the command for it to work.

    JimK

    Friday, October 12, 2012 4:48 PM
  • Thanks schnauzer,

    yes i did type the commend but still same error. For this i used farm account and i am sure it has all required access. But still it really bugs me that I cant get this works on SP2007!

    Sunday, October 14, 2012 10:25 AM
  • SharePoint 2016 gave a similar and was resolved by running PSCONFIG.  I wrote a blog post to document.

    https://www.spjeff.com/2017/12/26/fixed-stsadm-upgrade-command-has-been-replaced-by-psconfig-exe/

    stsadm -o upgrade -inplace b2b –force
    Command line error.  Invalid parameter.
    stsadm –o upgrade command has been replaced by psconfig.exe -cmd upgrade



    @SPJeff | www.spjeff.com


    • Edited by SPJeff Monday, January 15, 2018 4:00 PM
    Monday, January 15, 2018 4:00 PM