Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / Copying databases betw...
Finance forum

Copying databases between environments

(0) ShareShare
ReportReport
Posted on by 587

Hi all, 

I understand that the supported method to copy databases between non-production environments is to do back up/restore and then database synch as in 2012. Both of these environments are DEV and TEST with local SQL db and not on Azure. After I complete this step I will tackle the Azure UAT environment. 

However, are there any environmental parameters that need to be recorded or built into an update script? 

Thanks

  • Shakir Shabbir Profile Picture
    Shakir Shabbir 76 on at
    RE: Copying databases between environments

    Generally speaking, on any D365 Finance and Operations environment, the user which will remain always enabled is 'Admin'. This is not a user with System Administrator privileges in D365, but this a reserved user by D365 to be assigned to the environment administrator by default (or any other user which should be the defacto Admin).

    Now, when you copy a database from source, the source copies over all the information including the 'Admin' user. You should update the 'Admin' on the restored copy to the actual 'Admin' on the environment. To do this run the following script:

    DECLARE @SID NVARCHAR(124)

    DECLARE @NetworkAlias NVARCHAR(255)

    SELECT

    @SID = [SID]

    ,@NetworkAlias = NetworkAlias

    FROM [AxDB_Orig].[dbo].[UserInfo] WHERE Id = 'Admin'

    UPDATE [AxDB].[dbo].[UserInfo] SET

    [SID] = @SID

    ,NetworkAlias = @NetworkAlias

    WHERE Id = 'Admin'

    In the above script [AxDB_Orig] denotes the original database that was a working copy before restore.

  • Suggested answer
    SergiPB Profile Picture
    SergiPB 587 on at
    RE: Copying databases between environments

    Hi Sukrut,

    Spoke too soon. after I completed the database synchronization I am now able to get into the application.

  • SergiPB Profile Picture
    SergiPB 587 on at
    RE: Copying databases between environments

    I went through that document but my db is local to local. After the refresh I now receive:

    "You are not authorized to login with your current credentials. You will be redirected to the login page in a few seconds"

    I am logging on with my tenant account and not the admin account. Does anything have to get updated in the user info table?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,162 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans