Is this really the version you are looking for? Kentico Xperience 10 Documentation is no longer updated. Use the switcher in the header to choose your product version.
When using continuous integration, you can get changes from other developers or your source control system by loading XML files into your CIRepository folder. You then need to transfer the corresponding object changes to the database of your Kentico instance. Kentico provides a command line utility that deserializes the files and saves the object data back into the database.
Warning
The restore operation deletes any supported objects in the database that do not exist as files in the continuous integration repository. Before you run the restore process, make sure the CIRepository folder contains the required state of your object data.
To avoid loss of local data, you need to maintain the file system repository as a full image of your database – serialize all objects to the file system at the start of development and leave continuous integration enabled. You then need to merge the file content of the folder when loading data from another team member or the central source control.
Navigate to the CMS\bin folder of your Kentico project and run ContinuousIntegration.exe from the command line with the -r parameter.
ContinuousIntegration.exe -rThe utility deserializes the objects stored in the project's CIRepository folder and creates, overwrites or removes corresponding data in the database (specified by the connection string in the given project's web.config file).
To ensure that the restore process works correctly, you need to stop your Kentico application before running the restore process. Otherwise you may encounter the following problems:
Note: If you are using a web application project and always rebuild your solution after loading files from the source control, the application stops and starts automatically.
Restoring pages with staging enabled
If you perform the restore operation on an instance with Staging enabled, the system automatically logs staging synchronization tasks for any changes made to objects.
However, staging tasks are NOT logged for changes made to pages.To deploy page content from your development environment, you either need to use Export packages or run the continuous integration restore operation on the target instance (see Deploying data to production sites).
Restoring data from the CIRepository folder may create new smart search indexes or cause existing ones to become outdated.
If you wish to automatically keep your site's search functionality up-to-date after continuous integration restore operations, run ContinuousIntegration.exe from the command line with the additional -s parameter.
ContinuousIntegration.exe -r -sWhen restoring data with the -s parameter, the system automatically logs rebuild tasks for:
For example, if a restore operation updates the field search settings of a page type, the restore utility logs rebuild tasks for all page search indexes that include the given page type. The index rebuilds are processed when the application starts up after the restore operation.
Note: We do not recommend using the -s restore parameter if you have large search indexes with very long rebuild times. In these cases, you can rebuild your indexes manually as required.
We recommend setting up a process that runs the restore operation, stops/starts your application and performs any other required actions. For example, you can prepare a PowerShell (opens in a new tab) script.
# Parameter that specifies the path of your Kentico web project folder (i.e. the CMS subfolder)
param (
[Parameter(Mandatory=$true)]
[string]$Path
)
# Creates an 'App_Offline.htm' file to stop the website
"<html><head></head><body>Continuous integration restore in progress...</body></html>" > "$Path\App_Offline.htm"
# Runs the continuous integration restore utility
& "$Path\bin\ContinuousIntegration.exe" -r
# Removes the 'App_Offline.htm' file to bring the site back online
Remove-Item "$Path\App_Offline.htm"The script above is only a basic example that demonstrates the general concept. We recommend that you adjust the script to perform all functions required by your environment. The attached Restore-CI.ps1 file contains a more complete script that also stops and starts Kentico external services.
Custom restore solutions
Alternatively, you can use the Kentico API to implement a custom solution for restoring objects from the file system repository. See Restoring objects from the file system.