//Steps to restore model,Transactional database  files(.bak):-  

1)First shrink the both model,Transactional Database to get free space

//get SID

use master;
select * from  [ABC_AX_DEV].[dbo].[USERINFO] where id = 'Admin'


//The following are the SQL commands:

use master

//for Transactional Database
USE [ABC_AX_DEV]
select file_id, name from sys.database_files
dbcc shrinkfile(2,7)
dbcc shrinkdatabase(1,7)

//for model
use [ABC_AX_DEV_model]
select file_id, name from sys.database_files
dbcc shrinkfile(2,7)
dbcc shrinkdatabase(1,7)

2)select model
restore-->device-->selct your ".bak" file--->do the below steps

check OverWrite the existing database(WITH REPLACE).
check close existing connections to destination database.


3)do the same steps for Transactional Database

4) if u get error after  restored  your DB,model
"failed to logon MicrosoftDynamics AX"
   Please get your old DB,model SID and update now.

UPDATE [ABC_AX_DEV].[dbo].[USERINFO]
   SET [SID] = 'S-1-5-21-1042208094-427256881-525575295-500'
      , [NETWORKDOMAIN] = 'AX2012DEV.local'
      , [NETWORKALIAS] = 'Administrator'
     , [NAME] = 'Administrator'
WHERE ID = 'Admin'

Thank you.

Comments

Popular posts from this blog

x++ code to add hyperlink to a field in D365FO

x++ code to get Vendor Email Address based on Purpose in Dynamics 365 for Operations

x++ code to get Customer Address based on purpose in ax 2012