Показать сообщение отдельно
Старый 09.07.2024, 18:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
a33ik: Simple restore Bacpac file to AxDB using PowerShell commands
Источник: http://daxonline.org/1955-simple-res...-commands.html
==============

Vasily already described different types of moving DBs (SQL baks and Bacpac files) for tier1 and tier2 in his earlier article here Restore/move D365 database

Here you can find a specific case for BACPAC files within tier1 using Powershell commands below (in Bold):

  1. Open PowerShell as Administrator:
    If you do not have d356.fo tools installed, first run:
    Install-Module -Name d365fo.tools
    Invoke-D365InstallSqlPackage

  2. Restore BackPack file:
    Import-D365Bacpac -ImportModeTier1 -BacPacFile "C:/Temp/NewAxDB.bacpac" -NewDatabaseName "AxDB_new" -showOriginalProgress

    This process can take up to 2 hours so be patient.
  3. Stop your D365FO services so no active connections are locking your current AxDB:

    Stop-D365Environment

    Open IIS manager / Application Pools / AOSService / Stop.
    If you have open Visual Studio, also quit IISExpress - right click its icon in the tray (screen bottom left corner, usually inside ^ group) and click Exit.

  4. Switch databases:
    Switch-D365ActiveDatabase -SourceDatabaseName "AxDB_new" -DestinationSuffix "_old"
    Where "_old" is postfix for previously used AxDB so it will be renamed to AxDB_old. AxDBis now new active database.


  5. Start your D365FO services:
    Start-D365Environment

    Open IIS manager / Application Pools / AOSService / start
    Close all Visual Studio instances. Re-open Visual Studio.
    In VS go to Extensions > Dynamics 365 > Synchronize database


Источник: http://daxonline.org/1955-simple-res...-commands.html