At which step do CD restore in release pipeline?
We release using a devops release pipeline without a slot swap.
In which steps should we call the CD restore? First release the CD repository, then call the CD restore, and after that release the app and do the upgrades?
We now have a problem when calling CD restore, because a module-init tries to insert some records in a table which is not there yet. Too bad the module init runs before the CD restore when calling:
dotnet Site.dll --kxp-cd-restore --repository-path .\App_data\CDRepository
Site.dll is in this case the dll from the new release. (with the newly added tables / module code)
Environment
Xperience by Kentico version: [30.8.0]
.NET version: [9]
Execution environment: [Private cloud (Azure)]
Answers
Hi Roel,
Your error occurs because the application is still running during the restore process, which triggers module initialization while the required tables are missing.
Recommended steps:
- Deploy the new release files
- Stop the Xperience application or application pool before running the CD restore.
- Run the CD restore command
- Start or restart the application after the CD restore is complete.
For more details, refer to the official documentation:
Continuous Deployment – Kentico Documentation https://docs.kentico.com/documentation/developers-and-admins/ci-cd/continuous-deployment
Hi Nikhila,
Thanks for your help. i've doublechecked our pipeline, but the app service is really stopped:
- Stop app service
- Deploy release files
- run: dotnet Site.dll --no-build -- --kxp-cd-restore --repository-path .\App_data\CDRepository
- run: dotnet Site.dll --kxp-update --skip-confirmation=true
- Start app service
kxp-cd-restore does trigger the module initialization.
To answer this question, you have to login first.