locked
Restoring a database to a different server in a different domain? RRS feed

  • Question

  • I am attempting to restore a database backup file from server1 on DomainA to a new server2 on DomainB and when I attempt to restore the backup it fails with error 5:

    TITLE: Microsoft SQL Server Management Studio
    ------------------------------

    Restore of database 'DATABASE' failed. (Microsoft.SqlServer.Management.RelationalEngineTasks)

    ------------------------------
    ADDITIONAL INFORMATION:

    System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'D:\data2\DATA2.ndf'. (Microsoft.SqlServer.SmoExtended)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=14.0.17213.0+((SSMS_Rel).171128-2020)&LinkId=20476

    ------------------------------

    I have verified that the service account has access to the directory structure and so does the account that I am logged into the server as.

    Reviewing the backup set to restore shows the backup being run by DomainA\Username1. I am performing the restore as DomainB\Username2

    Can y'all please help me troubleshoot this?

    Sunday, February 11, 2018 9:07 AM

All replies

  • Looks like the executing account doesnt have access to path where mdf and ndf files are to be created as per the backup

    Try and repoint the mdf ldf files to a folder where your account has access to


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Sunday, February 11, 2018 9:31 AM
  • The operating system returned the error '5(Access is denied.)' 

    A pretty clear error message, ERROR_ACCESS_DENIED 5 (0x5) = Access is denied.

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Sunday, February 11, 2018 12:13 PM
  • That's the problem: I should have access to where I am putting the database files.

    At the root of the volume on server2, the local Administrators group has full access. I have added Domain Admins of DomainB to that group as well as the SQL Server service account, DomainB\SVCSQL.  So in theory I should have full access to everything in that volume, right?

    But I don't.

    Sunday, February 11, 2018 5:37 PM
  • That's the problem: I should have access to where I am putting the database files.

    At the root of the volume on server2, the local Administrators group has full access. I have added Domain Admins of DomainB to that group as well as the SQL Server service account, DomainB\SVCSQL.  So in theory I should have full access to everything in that volume, right?

    But I don't.

    Not necessarily, there are some folders which have to be explicitly provided access, like Windows installation folder for example

    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Sunday, February 11, 2018 6:22 PM

  • These are drives that I have mounted as folders in another drive, not special folders like the Windows Installations folder.

    Monday, February 12, 2018 6:58 PM
  • Hiee

    There could be various reasons behind the 'Access is Denied' Error. You can go through the following link to get solution:

    http://www.sqlserverlogexplorer.com/database-does-not-exist-access-denied/

    Wednesday, February 14, 2018 9:48 AM