Skip to content

Migration from TFS

TFS version

This migration mechanism is guaranteed to work with the 2012 version of TFS

This type of migration is carried out by interacting with the GitFlic CLI, which is supplied in the same archive as GitFlic.

Prerequisites

Before migrating, you need to make sure that:

1. The CLI is started by a user who has the rights:

  • to read the TFS database
  • to write static directories (/var/gitflic/) and the GitFlic database

2. An empty database has been prepared for transferring data from TFS. Migration is carried out only to a clean database.

3. The [git tfs utility] is installed(https://github.com/git-tfs/git-tfs ).

4. A file has been prepared containing the conversion of tfs users to git users in the following format:

{tfsServerName}\{tfsUserName} = {gitUserName} <{gitUserEmail}}>
Example of the file content:
WIN-SERVER\admin = admin <admin@test.local>
WIN-SERVER\user = user <user@test.local>

5. To transfer the branch correctly, it is recommended to open the "Source Control Explorer" for the folders corresponding to the branches, and then select "Branching and Merging" -> "Convert to Branch".

Launching the GitFlic CLI

1. Unzip the archive from the GitFlic software to any convenient directory

unzip gitflic_4.0.0_free_onpremise.zip

2. Navigate to the CLI directory inside the unpacked archive

cd /path/to/archive/cli

3. Make a script gitflic-cli.sh executable

chmod +x ./gitflic-cli.sh

4. To launch the GitFlic CLI, use the following command, adding the path to the configuration file of your GitFlic instance as an option:

./gitflic-cli.sh /path/to/application.properties

Implementation of migration

The migration process takes place in two stages - [export] (#export) and import. This approach allows migration to another host, including with a different operating system.

Exporting data from TFS

To export data from TFS, run the following command:

export-tfs \
--sql-server <SQL Server instance> \
--sql-database <Collection database name> \
--sql-username <SQL username> \
--sql-password <SQL password> \
--tfs-base-url <TFS baseURL of collection> \
--tfs-username <TFS username> \
--tfs-password <TFS password> \
--project-name <TFS project name> \
--owner-email <Email of collection owner in gitflic> \
--authors-filepath <Path to file with tfs-users to git-users conversion> \
--branches <Branch strategy (auto/all/none)>
Parameters Description
sql-server Name of the SQL server with the database
sql-database Name of the database where the collection is located
sql-username Username for connecting to the database (with data access)
sql-password User's password for connecting to the database
tfs-base-url URL for accessing the TFS collection
tfs-username Username for connecting to the TFS interface (with file download rights)
tfs-password User's password for connecting to the TFS interface
project-name Name of the target project
owner-email Email of the GitFlic user who will own the company (created based on the collection). The user with such an email must either exist in GitFlic, or be in the file on the path from the authors-filepath option.
authors-filepath The path to the user's tfs to git conversion file. The file must be accessible from the folder where the CLI is running.
branches Branch management strategy:
all (default and recommended for use): manage combined changesets and initialize all branches during cloning.
none' - ignore branches and merge changesets, extracting only the TFS clone path. <br>auto` - manage merged changesets and initialize merged branches
Example of a command
export-tfs \
--sql-server tfs.example \
--sql-database Tfs-test-collection \
--sql-username testname \
--sql-password testpassword \
--tfs-base-url https://tfs.example:8080/tfs/test-collection \
--tfs-username test \
--tfs-password test \
--project-name test-team \
--owner-email test@test.ru \
--authors-filepath C:\\test\\test\\authors.txt
--branches all 

The result of the export is the archive gitflic-tfs-migration-{epoch-seconds}.zip, which will be needed for further data import.

Importing data to GitFlic

To import data into GitFlic, run the following command:

tfs-import \
--archive-path <path to archive with export data> \
--owner-email <Email of collection owner in gitflic>
Parameters Description
archive-path Path to archive with export data from TFS
owner-email Email of the GitFlic user who will own the company (created based on the collection). The user with such an email must either exist in GitFlic, or be in the file on the path from the authors-filepath option
Example of a command
tfs-import \
--archive-path ./gitflic-tfs-migration-700000000.zip \
--owner-email test@test.ru

Migration result

After the migration, the GitFlic database will be created:

  • The users specified in the file from the authors-filepath option. All users who will migrate to GitFlic will have a temporary password set. A file will be created in the directory where the GitFlic CLI is located generated-password.txt containing temporary passwords. Immediately after logging in with a temporary password, all users need to change their password to a permanent one.
  • Company, corresponding to the collection with the owner whose email is specified in the owner-email option.
  • Project in a company with a git repository and issues corresponding to work items. Files from work items are attached to issues. Information about the name of the work item area and a list of links to related commits (change sets) will be added to the problem description. Issues will be created in statuses based on the statuses of the work items.
Relation of TFS and GitFlic statuses
Status in TFS GitFlic status
New New
To Do New
Design New
In Progress In Progress
Approved In progress
Committed In progress
Active In progress
Closed Cancelled
Removed Cancelled
Ready Completed
Done Completed

Possible errors

  1. If an error occurs related to an outdated TLS connection, it is necessary in the settings of java.security remove the lock on the use of TLSv1',TLSv1.1`.

Automated translation!

This page was translated using automatic translation tools. The text may contain inaccuracies.