---
title: Upgrading projects under source control
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

If you use a [source control system](https://en.wikipedia.org/wiki/Revision_control) (such as for example [Team Foundation Server](https://www.visualstudio.com/en-us/products/tfs-overview-vs.aspx) or [Git](https://git-scm.com/)) to manage the files of your Xperience project, you may need to perform additional manual steps when [upgrading](https://docs.kentico.com/13/installation/upgrading-to-xperience-13.md) to a newer version.

The following process allows you to retain most of the source control history and annotation data for files when upgrading:

**Limitation**: Currently, you cannot easily preserve source control history for files that the upgrade renames or moves to a different location.

1. Back up your Xperience project files, database and the related source control data.
2. Create a separate copy of your project and database (outside the scope of your source control system).
3. Perform the [standard upgrade](https://docs.kentico.com/13/installation/upgrading-to-xperience-13.md) for the _**copy**_ of your project, including all required steps (project file and database upgrade, steps before and after the upgrade, handling of customizations).
4. Check out _all files_ of the original project in your source control environment.

   > **Note:** **Note**: Before you perform the checkout, make sure that no files are locked or have pending changes.
5. Remove files that are no longer present in the target Xperience version from your source control repository:

   1. Open **upgrade**.**xml** in the upgrade installation directory, which contains a list of files that the upgrade deletes.
   2. Delete the listed files from your checked out web project. You can prepare a command line script that automates the process, for example:

      ```csharp title="Team Foundation Server - Commands for handling a file deleted by the upgrade"

      tf.exe undo "c:\Xperience\CMS\CMSModules\AdminControls\Controls\UIControls\PreviewEdit.ascx"
      tf.exe delete "c:\Xperience\CMS\CMSModules\AdminControls\Controls\UIControls\PreviewEdit.ascx"

      ```

      ```csharp title="Git - Command for deleting a file removed by the upgrade"

      git rm CMS/CMSModules/AdminControls/Controls/UIControls/PreviewEdit.ascx


      ```
6. Perform a comparison (difference operation) between the upgraded copy of the project files and the checked out original version. The output of the comparison must be a  _**list of new files that were added by the upgrade**_.

   > **Info:** You can use either the functionality of your source control system or other comparison tools, such as [Beyond Compare](http://www.scootersoftware.com/features.php).
   >
   > **Note**: The upgraded project may contain files that are not included in your source control, for example site folders containing data files, images, etc. To get the most accurate set of differences, you need to remove or disregard such files.
7. Copy all files from the upgraded project into your checked out source control repository and overwrite all existing files.
8. Add all new files to the source control (based on the list created in step 6). You can prepare a command line script that automatically runs the required source control commands, for example:

   ```csharp title="Team Foundation Server - Command for adding a new file"

   tf.exe add "c:\Xperience\CMS\Old_App_Code\CMSModules\Ecommerce\Extenders\CustomerEditExtender.cs"


   ```

   ```csharp title="Git - Command for adding a new file"

   git add CMS/Old_App_Code/CMSModules/Ecommerce/Extenders/CustomerEditExtender.cs


   ```
9. Check in (commit) the changes to your main source control repository.
10. Connect your main project to the upgraded copy of the database.

Your project is now upgraded, with source control history preserved for all files that are shared between the two versions.
