Database point-in-time restore (PITR)
You can use Microsoft Dynamics Lifecycle Services (LCS) to perform the point-in-time restore (PITR) for a sandbox user acceptance testing (UAT) environment. Microsoft maintains automated backups of the business and financial reporting databases for 28 days for production environments and 7 days for sandbox environments.
Self-service point-in-time restore
To restore the database of a standard user acceptance test (UAT) environment to a previous point-in-time, follow the steps outlined below:
- Go to your target sandbox Environment Details page, and select the Maintain > Move database menu option.
- Select the Point-in-time restore option and choose a point-in-time.
- Note the warnings. Review the list of data elements that are not copied over from the previous point-in-time.
- The restore operation will begin immediately.
Restore operation failed
In the event of failure, the option to do a rollback is available. If you select the rollback option after the operation originally fails, your target sandbox environment is restored to the state that it was in before the restore began. A rollback is often required if a customization that is present in the target sandbox environment can't complete a database synchronization with the newly restored data.
To determine the root cause of the failure, download the runbook logs using the available buttons before starting the rollback operation.
Data elements that need attention after restore
When you restore a database from a previous point in time, keep in mind that the database is provided "as was." For example, batch jobs and other data elements in the system can be in an in-progress state. These elements will require manual review.
Restore does affect the tables that store references to files stored in Azure blob storage (like document attachments and custom Microsoft Office templates). However, as Azure blob storage itself is not affected by this process, any files added after the restore point will continue to exist in Azure blob storage but will not be reflected in the database.
The system administrator account in the target environment (that is, the account that has a UserId value of Admin) is reset to the value that is found in the web.config file in the target environment. This value should match the value of the administrator account in LCS. To preview which account will be used, go to the Environment Details page for your target sandbox environment in LCS. The value that was selected in the Environment Administrator field when the environment was first deployed is updated to the system administrator in the transactional database. The tenant of the environment will be the tenant of the environment administrator.
If you've used the Admin User Provisioning Tool in your environment to change the value in the web.config file, the value might not match the value in LCS. If you require a different account, you must deallocate and delete the target sandbox environment, and then redeploy it by selecting another account. You can then do another refresh database action to restore the data.
Steps to complete after a database restore for environments that use Commerce functionality
Some environment-specific records are not included in automated database movement operations and require additional steps. These include the following:
- Commerce self-service installer references
- Commerce Scale Unit channel database configuration records
If you copy a database between environments, Commerce capabilities in the destination environment will not be fully functional until you perform the following additional steps.
Initialize Commerce Scale Units
If you are moving a database to a sandbox UAT or production environment, you must Initialize Commerce Scale Unit after the database movement operation is complete. The Commerce Scale Unit's association from the source environment will not copy over to the destination environment.
Synchronize Commerce self-service installers
To be able to access Commerce self-service installers in HQ, you must Synchronize self-service installers after the database movement operation is complete.
The Environment re-provisioning step has now been fully automated as part of database movement operations, and no longer needs to be run manually. The Environment re-provisioning tool is still available in the Asset Library and may be used in certain situations to mitigate error conditions.
To run the Environment re-provisioning tool on the destination environment, run the following steps:
- In your project's Asset Library, in the Software deployable packages section, select Import.
- From the list of shared assets, select the Environment Reprovisioning Tool.
- On the Environment details page for your destination environment, select Maintain > Apply updates.
- Select the Environment Reprovisioning tool that you uploaded earlier, and then select Apply to apply the package.
- Monitor the progress of the package deployment.
For more information about how to apply a deployable package, see Create deployable packages of models. For more information about how to manually apply a deployable package, see Install deployable packages from the command line.
Re-activate POS devices
If you use point of sale (POS) devices, after you import a database you must activate the POS devices again. Previously activated devices in the destination environment will no longer function. For more information, see Point of sale device activation.
Breaking the chain of available restore points
Several frequently used actions create a new database that won't have the same restore point history as the previously used database. These actions include point-in-time restores, database refreshes, database imports, and point-in-time restores from the production environment to the sandbox environment. In addition, if a software deployable package that you apply to your environment fails during update of the database, and you use the rollback functionality in LCS, the rollback functionality does a point-in-time restore of the database, and that restore also creates a new database.
Although the new database doesn't have any restore point history, it does begin to accrue new restore points from that time onward. After you perform any of the previously mentioned actions, you can't perform it again by using the same restore date and time.
Restore is denied for environments that run Platform update 20 or earlier
The restore database process cannot be completed if the environment is running Platform update 20 or earlier. For more information, see the list of currently supported Platform updates in the Software lifecycle policy and cloud releases.