Change Database Location
note
Database AccessibilityPlease ensure that database files are accessible from within YouTrack!
The user account that runs the YouTrack service should always have permission to create, modify, and read database files.
Access to database files over the network is prohibited because YouTrack cannot guarantee the durability of your data when accessed in this way. Specifically, you must not use NFS to store the YouTrack database.
![YouTrack data directory YouTrack data directory](https://resources.jetbrains.com/help/img/youtrack/2024.3/youtrackDataDirectory.png)
note
The steps for performing this operation vary by installation type. Before you start, make sure you have selected the tab that corresponds to your YouTrack installation.
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.
Back up the database. Just in case.
Stop the YouTrack Docker container. For specific instructions, see Stop a Docker container.
Create a new directory for the database.
Move the content of the current database directory (
data
) to the new directory.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.note
If you run the docker container in a macOS environment, the new database directory is automatically accessible to the user who starts the container. Skip this step and continue.
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.
Thanks for your feedback!