1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

psarestore error: sh: - : invalid option

Discussion in 'Plesk for Linux - 8.x and Older' started by kyoo, Feb 12, 2006.

  1. kyoo

    kyoo Guest

    0
     
    I'm receiving an error message when I try to restore using psarestore. I've done the backup using this version:
    [root@web1 backup]# rpm -qf /usr/local/psa/bin/psarestore
    psa-bu-7.5.4-rh7.3.build75050926.17

    And I'm doing the restore using this version:
    [root@clone plesk]# rpm -qf /usr/local/psa/bin/psarestore
    psa-bu-7.5.4-rhel4.build75050926.17

    So the versions are the same, except the OS's. While doing the restore, I receive several "sh: - : invalid option" errors at various sections of the restore process. Two errors are shown.. others include while restoring directories.. it seems to be in between virtualhosts. Sometimes it occurs after creating the mysql DB for one virtual host and before the next domain's restoring directories step.

    Any ideas? Things are still restoring, so I don't know yet if there are any obvious problems. This is my trial run. Trying to prepare for the real migration. I'd like to figure out the problem before the real run.

    Thanks! --Kyoo

    Saving certificate web1 public key ... done
    Saving certificate web1 private key ... done
    sh: - : invalid option
    Usage: sh [GNU long option] [option] ...
    sh [GNU long option] [option] script-file ...
    GNU long options:
    --debug
    --debugger
    --dump-po-strings
    --dump-strings
    --help
    --init-file
    --login
    --noediting
    --noprofile
    --norc
    --posix
    --protected
    --rcfile
    --rpm-requires
    --restricted
    --verbose
    --version
    --wordexp
    Shell options:
    -irsD or -c command or -O shopt_option (invocation only)
    -abefhkmnptuvxBCHP or -o option
    sh: - : invalid option
    Usage: sh [GNU long option] [option] ...
    sh [GNU long option] [option] script-file ...
    GNU long options:
    --debug
    --debugger
    --dump-po-strings
    --dump-strings
    --help
    --init-file
    --login
    --noediting
    --noprofile
    --norc
    --posix
    --protected
    --rcfile
    --rpm-requires
    --restricted
    --verbose
    --version
    --wordexp
    Shell options:
    -irsD or -c command or -O shopt_option (invocation only)
    -abefhkmnptuvxBCHP or -o option
    Restoring directory: /var/www/vhosts/domain1.com/ ... done
     
  2. bperfect

    bperfect Guest

    0
     
    I am facing EXACTLY the same problem.. did your restore complete successfully ?
     
  3. kyoo

    kyoo Guest

    0
     
    I ended up doing the server migration..if those errors meant something important, then I still haven't discovered what it was. It's been a full week now.

    There were a few things that I had to deal w/ afterwards.

    php register_globals turned off by default.. a few sites needed it turned back on via their vhosts.conf.

    index.htm no longer works as a default page.. I had to symbolically link those to index.html's on a couple of sites.

    A single "web user" that existed for one of the domains seemed to have a password that didn't work. I had to reset it. Not sure what was up with that.

    Oh, and don't forget to open up your iptables firewall config to open up imap, imaps, pop, pops, 8443, smtp, https, http, etc..
     
  4. bperfect

    bperfect Guest

    0
     
    after restore all domain's ftp passwords stopped working.. but after resetting them from plesk they started working back again, but it is a nightmare to handle 500+ domains .. anyway to fix ftp password problem quickly ?
     
  5. kyoo

    kyoo Guest

    0
     
    yah. wish I knew.. i found a few more accts with passwords that were broken.. it didn't seem that ALL of them were broken, though.

    come to think of it, the error I was seeing is probably something to do with the useradd command with the '-p' argument to pass in the md5 password hash. I'm guessing that psarestore isn't properly escaping the $ characters.. so any users that have $'s in their md5 pw hashes have broken passwords.

    this is just a guess.
     
  6. bperfect

    bperfect Guest

    0
     
    to me it appears it has something to do with ES4. Anyway all my passwords are broken.. but I am hopeful someone shall reply with a fix.. thanks
     
  7. zooming

    zooming Regular Pleskian

    25
    57%
    Joined:
    Jul 12, 2006
    Messages:
    112
    Likes Received:
    0
    I'm migrating from RHEL 3 to RHEL 4, and having the same problem.
    Both servers are updated, with version 7.5.4
     
  8. JohnD@

    JohnD@ Guest

    0
     
    Having the same problem moving from RedHat 7.3 to RHEL4 / Centos 4.3... it's a pretty big jump, but according to PLESK it should not be a problem. Latest buiild of PLESK7.5 Reloaded on both servers.

    Did any of you come up with a solution on how to migrate the data without any big issues? Does the server migration-tool work betetr then backup/restore?

    Thanks.
     
  9. zooming

    zooming Regular Pleskian

    25
    57%
    Joined:
    Jul 12, 2006
    Messages:
    112
    Likes Received:
    0
    I think you can edit the restore.sh script and fix this syntax error, good luck.
    I will stay in RHEL 3 in the new server too.
     
  10. JohnD@

    JohnD@ Guest

    0
     
    Thanks for the reply zooming but I'm not sure that I follow... Exactly where and what should I edit? Only got a bounch of dump.xx files or am I missing something?
     
  11. JohnD@

    JohnD@ Guest

    0
     
    The restore seams to have worked more or less exept for FTP passwords. After the expert response from PLESK support saying...

    ...I ended up writing a PHP script that resets all FTP passwords. Perhaps someone might have use for it. Simply create a file called passwd.php i /home/httpd/vhosts/default/htdocs/ (or somewhere that is can be seen from the web) and paste the following:


    It's not the best of PHP programming but it works ;-) Access this page from the web and you will end up having a nice shell-script that will set the FTP password correct...

    What it does is simply to get FTP username and password from the PLESK database and putting it into a bunch of passwd-commands...

    And don't forget to remove this from the server as the username/passwords are beeing show in simple text.

    I'm happy if it can help someone. It saved me from looking up and running thousends of passwd commands. And PLESK support really need to... well... give support on thir product?!
     
  12. Tekkel

    Tekkel Guest

    0
     
    Thank you for the script. It did not do the whole trick on our servers. In the files /etc/passwd and all the other password and groupfiles there were wrong paths mentioned. The path of the server restored on was /var/www/vhosts, the path of the restore file was /usr/local/psa/home/vhosts. After the restore the vhost dir was moved from /var/www to /usr/local/psa/home. The path in the various password file thus was wrong. Using the replace command in /etc:

    replace "/var/www/vhosts" "/usr/local/psa/home/vhosts" -- *

    updated all the files containing the wrong path. Now all ftp logins are working again!
     
  13. zooming

    zooming Regular Pleskian

    25
    57%
    Joined:
    Jul 12, 2006
    Messages:
    112
    Likes Received:
    0
    I'm not sure, but I think you can edit the restore.sh script file and correct the wrong command's syntax.
    It looks like that some shell command have it's syntax changed from RHEL3 to RHEL4, and the restore.sh file does not take that in account.
     
  14. zooming

    zooming Regular Pleskian

    25
    57%
    Joined:
    Jul 12, 2006
    Messages:
    112
    Likes Received:
    0
    You will not find the error message in the log file.
    You will only see this message if you watch the restore messages while it is running.
     
  15. zooming

    zooming Regular Pleskian

    25
    57%
    Joined:
    Jul 12, 2006
    Messages:
    112
    Likes Received:
    0
    Hello Everybody,

    Swsoft's support staff gave me a patch (bu-patches.tgz) that solved this problem.

    :) :) :)
     
  16. thewolf

    thewolf Regular Pleskian

    25
    57%
    Joined:
    Mar 11, 2004
    Messages:
    231
    Likes Received:
    0
    Hi,

    I hit the same error when restoring a Plesk 7.5 for RHEL3 dump file on Plesk 7.5 on RHEL4.

    Would you mind sharing the patch (e.g. uploading it to this thread)?

    Thanks.
     
  17. zooming

    zooming Regular Pleskian

    25
    57%
    Joined:
    Jul 12, 2006
    Messages:
    112
    Likes Received:
    0
  18. frostie

    frostie Guest

    0
     
    Just to bring this up. That link does not work and i'm now looking to mobilise my data, and correct this issue.

    Does anyone know where is psarestore the line is that needs to be altered?
     
Loading...