YouTrack Standalone 2021.1 Help

Change Database Location

YouTrack uses its own in-process database. By default, data files are saved to the <youtrack_home>/data directory.

The default directory where YouTrack stores data contains the following subdirectories:

NameDescription
youtrackContains the YouTrack database
hubContains the database for the Hub service, if built-in Hub has ever been used for the YouTrack instance
internalMay contain other internal product data

When you copy your existing database to the new location, make sure the new location uses the same folder structure that is shown here.

YouTrack data directory

As YouTrack service runs inside a Docker container, you can change only the location of the database on the hosted machine. In this case you need to move the database to a new location, and then specify the new path as parameter of the docker run command.

  1. Back up the database. Just in case.

  2. Stop the YouTrack Docker container. For specific instructions, see Stop YouTrack docker container.

  3. Create a new directory for the database.

  4. Move the content of the current database directory (data) to the new directory.

  5. Provide the user 13001:13001 that runs the YouTrack service inside the container with access permissions to the new database directory. For details, see Create and Configure Directories.

  6. Run the Docker container with the new path to the database on the hosting machine:

    docker run -it --name <youtrack-server-instance> \ -v <path to new data directory>:/opt/youtrack/data \ -v <path to conf directory>:/opt/youtrack/conf \ -v <path to logs directory>:/opt/youtrack/logs \ -v <path to backups directory>:/opt/youtrack/backups \ -p <port on host>:8080 \ jetbrains/youtrack:<version>
    • YouTrack service starts with the data directory inside the container (/opt/youtrack/data) mapped to the new database location on the hosting machine.

Use the same procedure to change the location of the conf, logs, backups, and/or temp directories.

If you run YouTrack as a standalone Java process, you can specify the database location in the command line.

To change the database location:

  1. Stop the YouTrack server.

  2. Move your existing database to the new database directory.

  3. Run the following command to set the location of the new data directory:
    java -jar youtrack-<version>.jar --data-dir=<new YouTrack database directory>

  4. Start the YouTrack server.

For MSI distributions, you can change the default location of the YouTrack database with the configure command in the command line. To execute these commands in an MSI distribution, open the Command Prompt window as an administrator.

To change the database location:

  1. Stop the YouTrack service. For specific instructions, see Stop and Start YouTrack.

  2. Move your existing database to the new database directory.

  3. Run the following configure command to set the location of the new data directory:
    <youtrack_home>\bin\youtrack.bat configure --data-dir=<new YouTrack database directory>

  4. Start the YouTrack service. For specific instructions, see Stop and Start YouTrack.

For ZIP distributions, you can change the default location of the YouTrack database with the configure command in the command line.

To change the database location:

  1. Stop the YouTrack service. For specific instructions, see Stop and Start YouTrack.

  2. Move your existing database to the new database directory.

  3. Run the following configure command to set the location of the new data directory:
    <youtrack_home>/bin/youtrack.sh configure --data-dir=<new YouTrack database directory>

  4. Start the YouTrack service. For specific instructions, see Stop and Start YouTrack.

Last modified: 15 April 2021