- On the server that is running SQL Server Management Studio, fire up SQL Server Management Studio
- Log in with a user that has access to the MSCRM_CONFIG and related databases
- Expand the databases
- Right click and select Tasks -> Backup
- On the screen that appears, verify that the selected database is correct
- Under destination, it will default to the default backup folder set during the install of SQL
- If this is where you want to store the naming convention you want, leave this field alone. Our best practice though is to include the date you took the backup in the name, in YYYYMMDD format.
- You shouldn’t need to update anything under the media tab
- Under the backup options tab, you have the ability to set whether or not you want to compress the database. For the most part, Microsoft Dynamics CRM databases are relatively small, but the size of your database and the space on your server should really determine whether or not you compress. For more information on compressing databases in SQL Server: https://msdn.microsoft.com/en-us/library/bb964719.aspx
- You’re good to go! Hit okay and wait for the backup to complete
Restore Database Backup
- There are multiple ways to move your database backup, the easiest of which is to map network drives and move the backup from one Virtual Machine to another
- Our best practice is to drop the backup in the SQL Backup folder
- Once you have the backup of your database on your target server, fire up SQL Server Management Studio
- Right click on databases and select restore database
- Toggle the source to device and hit the ellipses
- This will prompt you to select your backup device
- The location will default to the Backup location specified during SQL setup. If this isn’t where you stashed your backup, navigate to where you stored it and select it
- Hit okay, and the UI will spin up the relevant information
- Under destination, database: update the database name to use the new name on the new server
- Under the files tab, you can update where the Rows and Log are stored, our best practice is to leave these in the Data directory
- Verify that the database name in these two files updated when you changed the database name in step 9
- You’re good to go! Hit okay and wait for the restore to complete
Reimport your Org
- Fire up deployment manager
- Select Organizations, and on the right hand side select Import Organization
- Under organizational database, your freshly restored database should appear, hit continue
- Update the display name for your org, the unique database name will automatically update
- You can then select to automatically map users, or use a custom mapping, this is really personal preference
- You’ll then be prompted to map your users, or you’ll pass the user checks, depending on what you select previously
- Hit continue, and deployment manager will kick off the System Check
- Once that is complete, hit continue, verify the information is correct, and then hit import
- Wait for the import to complete, and once it’s finished, you’re all done!
resources
1- https://www.cobalt.net/how-to-back-up-and-restore-a-database-in-a-crm-organization
2- https://learn.microsoft.com/en-us/dynamics365/customerengagement/on-premises/deploy/back-up-the-microsoft-dynamics-365-system?view=op-9-1