First post in year 2020, I am surprised by myself that I haven't managed to make a single post this year - given that I am, like most of you, working from home for the majority of the year.
Anyways, here comes a small tip about Copying Databases. With Dynamics 365 for Finance and operations (now a.k.a Dynamics 365 for Finance, Dynamics 365 for Supply Chain Management and also Dynamics 365 for Commerce) - you might be in need to perform several database operations during the Project implementation phases. Also you might want to take a back up of the existing database for recovery perspective.
Below is something which I use to support with Copy actions on databases.
How to make a quick copy of AXDB hosted in Azure SQL (Tier 2 and above)
- To begin connect to the Azure SQL database from within the primary AOS server (AOS 01 - because this is where you would great maximum permissions to perform actions on SQL database)
- You should use the credentials from LCS to connect to Azure SQL database from SSMS in AOS 01
- Open the SQL Query window
- And use the below command to perform copy action
CREATE DATABASE [Name-for-New-Copy] AS COPY OF [Database-name-of-the-Source-DB(AXDB)]; - Once you execute this commend, you would get a message stating that action is finished and usually SSMS is quick to give you this message
- However, important to understand is that this is only the trigger, the copy continues in the background
- You could confirm by looking at the database size of the [New copy]
- I usually leave it overnight
How to make a quick copy of AXDB hosted in SQL Server (Tier 1 and/or Cloud hosted environments)
- The easiest way is always to use the functions available in SSMS UI
- Connect to SQL database using SSMS in the server
- Usually credentials are auto-populated with the User details
- Right click on the [Source] database > Tasks > Copy Database
- Just follow the wizard
- However, Important to understand that SQL Server Agent needs to be Active for this to work
- Another tip, if you are working with Microsoft Managed Tier-1 environment, easiest way to get around SQL Server Agent is to go to Services.msc and start the service from in there
- Once you are all set, Click on Finish on the Wizard and you should have copy of your database soon enough