Change Database Location
The default directory where Hub stores data contains the following subdirectories:
Name | Description |
---|---|
hub | Contains the database for the Hub service |
internal | May 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.
Change Database Location a ZIP or MSI distribution
You can use the following procedure to change the database location for both ZIP and MSI distributions. To execute these commands in an MSI distribution, open the Command Prompt window as an administrator.
To change the database location:
- Back up the database. Just in case.
- Stop the Hub service. For specific instructions, see Stop and Start the Hub Service.
- Move your existing database to the new database directory. For an MSI installation, make sure that the local user
JetBrainsHub
has full access to the new data directory and all its content. - Enter the following
configure
command to set the location of the new data directory:
<hub_home> bin/hub.sh configure --data-dir=<new Hub database directory>
- For a ZIP installation, the
<hub_home>
directory is the location where the ZIP distribution was unpacked during installation. - For an MSI installation, the
<hub_home>/bin
directory is the location where the MSI distribution was installed. The default installation directory isC:\Hub
- For a ZIP installation, the
- Start the Hub service. For specific instructions, see Stop and Start the Hub Service.
Other Directories
If you move your database to another server, you may also want to change the location where Hub stores logs and temp files.
To change the location of these files, follow the same procedure that is described for changing the database location and execute the following commands in the script file:
Directory | Command |
---|---|
Backups | configure --backups-dir=<new Hub backups directory> |
Logs | configure --logs-dir=<new Hub logs directory> |
Temp | configure --temp-dir=<new Hub temp directory> |
Database Location for a Docker Installation
As Hub 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 Hub docker container. For specific instructions, see Stop and Start the Hub Service.
- 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 Hub service inside the container with the access permissions to the new database directory. For more details, see the Docker Installation page. - Run the docker container with the new path to the database on hosting machine:
docker run -it --name <hub-server-instance> \ -v <path to new data directory>:/opt/hub/data \ -v <path to conf directory>:/opt/hub/conf \ -v <path to logs directory>:/opt/hub/logs \ -v <path to backups directory>:/opt/hub/backups \ -p <port on host>:8080 \ jetbrains/hub:<version>
- Hub service starts with the data directory inside the container (
/opt/hub/data
) mapped to the new database location on the hosting machine.
- Hub service starts with the data directory inside the container (
The same way you can change location of the conf
, logs
, backups
, and temp
directories.