Migration fails: error: Failed to copy content of database 'db-name'

Created:

2016-11-16 13:15:29 UTC

Modified:

2017-08-08 13:21:50 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Migration fails: error: Failed to copy content of database 'db-name'

Applicable to:

  • Plesk 12.0 for Windows
  • Plesk 12.5 for Windows

Symptoms

  • Plesk migraton fails with the following error in the migration result page:

    ;error: Failed to copy content of database 'db-name'
    Migration tools tried to perform operation in 3 attempts: Command cmd.exe /C " --restore -server= -server-type=mssql -server-login= -server-pwd="**********" -database= -backup-path= with arguments {'dst_admin': 'mainsa', 'database_name': 'db-name', 'dbbackup_path': u'C:\\\\Program Files (x86)\\\\Parallels\\\\Plesk\\\\admin\\\\bin\\\\dbbackup.exe', 'dst_host': 'localhost', 'backup_path': u'D:\\\\pleskdata\\\\var\\\\modules\\\\panel-migrator\\\\sessions\\\\20160221132034\\\ arget-server\\\\mssql-dumps\\\\db_backup_example.com_db-name.sql'} failed with exit code 22
    stdout: Unable to restore database 'db-name'

    Not valid backup:

    Cannot open backup device 'D:\\pleskdata\\var\\modules\\panel-migrator\\sessions\\20160221132034\ arget-server\\mssql-dumps\\db_backup_example.com_db-name.sql'. Operating system error 5(Access is denied.).
  • Downloaded debug.log contains errors like below:

    ;+|2016-02-21_18:51:23,115|W|ST1|core.utils.database_utils|example.com||Failed to set permissions for directory with MSSQL database dumps: Command icacls {dir} /grant ".\\sqlserver:(OI)(CI)F" with arguments {'dir': 'D:\\\\pleskdata\\\\var\\\\modules\\\\panel-migrator\\\\sessions\\\\20160221184439\\\ arget-server\\\\mssql-dumps'} failed with exit code 1332
    =|2016-02-21_18:51:23,115|W|ST1|core.utils.database_utils|example.com||stdout: Successfully processed 0 files; Failed processing 1 files

    =|2016-02-21_18:51:23,115|W|ST1|core.utils.database_utils|example.com||
    =|2016-02-21_18:51:23,115|W|ST1|core.utils.database_utils|example.com||stderr: .\\sqlserver: No mapping between account names and security IDs was done.
  • MSSQL server is running under sqlserver user.

Cause

Plesk Migrator tries to set permissions for directory with MSSQL database dumps for incorrect user.

Resolution

For both source and destination servers, make sure that HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\services\\MSSQLSERVER\\ObjectName registry value is the same as the username under which MSSQL server is running.

Have more questions? Submit a request
Please sign in to leave a comment.