Import Issues from Another YouTrack Server
This page provides instructions for importing issues from one YouTrack server to another with the Python Client Library. Use these instructions to:
Before you begin, consider your options. Follow these instructions only when you want to migrate a limited number of projects or issues. If you want to migrate an entire database, use another solution instead:
If you simply want to move a YouTrack Standalone installation from one server to another, you can configure your new YouTrack server to use a copy of your old database. For instructions, see Change Database Location.
Permissions
The user account that you use to log in to the source YouTrack server requires permission to read issues and all their attributes including custom fields in the project to be imported. The user account that you use to log into the target YouTrack server requires permission to create and update a project, create users, read issue private fields, and update issue private fields. We recommend that you use an account with a System Admin role for both source and target servers.
Import Details
When you import issues from another YouTrack server, be aware of the following mechanics:
Issues are imported on a per-project basis. The source project is specified by its
projectID
. When issues are imported, all of the entities that are referenced in issue attributes are imported as well. This includes users (from issue fields like Reporter and Assignee) and sets of values for custom fields.When a user is imported, the user account is assigned a randomly-generated password. When users log in to the target YouTrack server with credentials from the source server, they must use the Send password restore email link to reset their passwords.
Only custom fields that are used in the target project are imported from the source YouTrack server. To make sure that you import all of the data from the source server, check the project in the target server and verify that it contains the correct number and type of custom fields.
Import All Issues in a Project
The Python script lets you import all issues from a source project at once. The target project is created automatically.
To import all issues in a project from one YouTrack server to another:
Download the latest version of YouTrack's Python Client Library and unzip it.
Ensure that either Python or JPython is installed in your system.
- Execute the following command: Specify values for the following parameters in the command:
python youtrack2youtrack.py source_url source_login source_password target_url target_login target_password projectId
Parameter
Description
source_url
The URL of the source YouTrack server to import issues from.
source_login
The username of the account you use to log in to the source YouTrack server.
source_password
The password of the account you use to log in to the source YouTrack server.
target_url
The URL of the target YouTrack server to import issues to.
target_login
The username of the account you use to log into the target YouTrack server.
target_password
The password of the account you use to log in to the target YouTrack server.
projectId
The
projectID
of the project to import to the target YouTrack server. Check the target YouTrack server and verify that the issues are imported correctly.
Import Single Issues
In some situations, you might want to import issues one at a time. For example, when you want to migrate an issue from an internal YouTrack instance to your public tracker. The Python script used in this procedure imports a single issue from a source project to an existing project in another YouTrack server.
Follow these steps to import single issues from one YouTrack instance to another.
To import a single issue from one YouTrack instance to another:
Download the latest version of YouTrack's Python Client Library and unzip it.
Ensure that either Python or JPython is installed in your system.
- Execute the following command: Specify values for the following parameters in the command:
python moveIssue.py src_url src_login src_password trg_url trg_login trg_password src_issueId trg_projectId
Parameter
Description
src_url
The URL of the source YouTrack server to import issues from.
src_login
The username of the account you use to log in to the source YouTrack server.
src_password
The password of the account you use to log in to the source YouTrack server.
trg_url
The URL of the target YouTrack server to import issues to.
trg_login
The username of the account you use to log into the target YouTrack server.
trg_password
The password of the account you use to log in to the source YouTrack server.
src_issueId
The
issueID
for the issue that you want to import to the target YouTrack instance.trg_projectId
The
projectID
of the project in the target YouTrack instance that you want to import the source issue to. Check the target YouTrack server and verify that the issue was imported correctly.