Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $bacpacFile = 'D:\Backup\sandbox_adhoc.bacpac'
- $sourceDatabaseName = "AxDB_Source_$(Get-Date -UFormat "%y%m%d%H%M")"
- #Remove any old temp source DB
- Remove-D365Database -DatabaseName $sourceDatabaseName -Verbose
- #Stop local environment components
- Stop-D365Environment -All
- # Import the bacpac to local SQL Server
- Import-D365Bacpac -ImportModeTier1 -BacpacFile $bacpacFile -NewDatabaseName $sourceDatabaseName -Verbose
- #Remove any old AxDB backup (if exists)
- Remove-D365Database -DatabaseName 'AxDB_original' -Verbose
- #Switch AxDB with source DB
- Switch-D365ActiveDatabase -DatabaseName 'AxDB' -NewDatabaseName $sourceDatabaseName -Verbose
- Start-D365Environment -All
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement