Unable to restore backup: 'Wrong syntax for command's '-passwd' parameter'

Refers to:

  • Plesk 12.5 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux

Created:

2016-11-16 12:51:52 UTC

Modified:

2016-12-21 19:24:11 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to restore backup: 'Wrong syntax for command's '-passwd' parameter'

Symptoms

When trying to restore a backup copied directly from a Plesk server, the process fails with the following error or warning (while hosting is not restored):

Wrong syntax for command's '-passwd' parameter.

Warning: domain "example.com"
Execution of /opt/psa/admin/plib/api-cli/domain.php --update example.com -guid 4314fea8-ef69-41ac-97da-e0828b95eff8 -creation-date 2012-08-05 -hosting true -hst_type phys -do-not-apply-skeleton -ip 203.0.113.2 -www-root httpdocs -login example_com -passwd '' -passwd_type sym -ignore-nonexistent-options failed with return code 1.

Cause

If secure passwords are enabled on the server, then passwords for the following user categories will be encrypted with reversible (symmetric) encryption using a server-specific key:

  • Control Panel users
  • Mail users
  • FTP users
  • Protected directory users
  • Database users

If such backup is copied "as is", a target server attempt to restore it will result either in numerous password-related errors or unexpected behavior.

Resolution

1) If possible, export the backup – save it from the Plesk interface or upload it to an FTP repository. When you do this, the Plesk server will decrypt the passwords in order to make the backup portable.

2) If an export is not possible (for example, if the original server is down), then the only way to restore the backup is to replace all passwords of the "sym" type in the backup XML file with regular passwords.

In order to do that, you can use the fix_sym_passwd.pl utility from the fix_passwords_115421.zip archive. It is used in the following way:

    # find /var/lib/psa/dumps -name '*_info_1301112335.xml' -exec ./fix_sym_passwd.pl '{}' \\;

Note : Replace the above backup timestamp with that of the one you are trying to restore. Original XML files will be saved with a "~" suffix. Move all *.xml~ files to another location because they can prevent a restoration process (software issue PPPM-3140 ).

To get a list of new randomly generated passwords from such a backup, use the get_passwd_from_dump.sh script from the same archive mentioned above. Example of usage:

    # ./get_passwd_from_dump.sh /var/lib/psa/dumps/backup_info_1301112335.xml
Have more questions? Submit a request
Please sign in to leave a comment.