Symptoms
Migration/backup/restore/import/export of a Microsoft SQL database fails with one of the following error messages:
Cannot open backup device 'C:Program FilesPleskPrivateTempTemp47385.tmp'. Operating system error 5(failed to retrieve text for this error. Reason: 15105).
BACKUP DATABASE is terminating abnormally.
Unable to backup database content. Database db_example. Db server .MSSQL2016:
Cannot open backup device 'C:WindowsTEMPtmp78C9.tmp'. Operating system error 5(Access is denied.).
BACKUP DATABASE is terminating abnormally.
Cannot open backup device 'C:Program Files (x86)ParallelsPleskvarmodulespanel-migratorsessions20180910022943target-servermssql-dumpsdb_backup_example.com_db_example'. Operating system error 5(Access is denied.). VERIFY DATABASE is terminating abnormally.
Cause
Insufficient permissions for the user used by Microsoft SQL instance on a folder from the error message.
Resolution
-
Connect to the Plesk server via RDP.
-
Find the current Microsoft SQL system user:
2.1. Start a command prompt as an administrator and run the following command to launch Windows Services:
C:> services.msc
2.2. In Windows Services, double-click on SQL Server to open its Properties.
2.3. In the SQL Server Properties window, switch to the Log On tab and copy the full name of the account:
Note: The MSSQL user has to be "NT ServiceMSSQL$MSSQLSERVERXXXX" where XXXX is a Microsoft SQL version.
-
Now grant this MS SQL user a full control to the folder from the error message.
In the example below, we are granting the MS SQL user a full control to the folder %plesk_dir%varmodulespanel-migratorsessions20180910022943 from the error message.
3.1. Right-click on the folder %plesk_dir%varmodulespanel-migratorsessions20180910022943 to open its Properties.
3.2. In the Properties window, switch to the Security tab and click Edit....
3.3. On the Permissions window, click Add....
3.4. In the opened window, past Microsoft SQL user name from step to and click Check Names. Click OK.
3.5. On the Permissions window, select the added user and allow him full control. Click OK to apply the changes.