Get a Database Backup
Use the REST API to get a backup of your YouTrack database.
Summary
To get a backup of the YouTrack database:
- Get a list of available backups.
- If required, create a new backup.
- Get the URL of the new backup.
Please note that any reading operation with a backup requires Low-level Admin Read permission. If you need to create a new backup file, you will need a user account that is granted Low-level Admin Write permission.
Step-by-Step
Get a list of Available Backups
To get a list of available backups, send a GET request to the database backups endpoint:
/api/admin/databaseBackup/backups
In response, you will get a JSON object containing one or more database backups.
In YouTrack Cloud, you can only have one backup file stored on your instance. This fact makes the task of getting the fresh backup a bit easier: you do not need to get the list of backups as you always have a single one. You can start with creating the fresh backup, and then get its attributes and downloading link.
Use the following syntax for the request:
GET /api/admin/databaseBackup/backups>?fields=
Pay attention to the fields request parameter. It should contain a list of database backup entity attributes, that YouTrack must return in response to your request. If you do not specify any field here, you will get only the entity ID and \$type of each found database backup. Read more about fields syntax in YouTrack REST API.
Sample request
curl -X GET \ ‘https://example.youtrack.cloud/api/admin/databaseBackup/backups?fields=creationDate,file,error,link,name,size,id’ \ -H ‘Accept: application/json’ \ -H ‘Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7’
Sample response body
Optional: Create a Fresh Backup
If you wish to create a fresh backup, send a POST request to the following endpoint:
/api/admin/databaseBackup/settings
As the payload, send a JSON object backupStatus instructing the server to initiate the backup.
For instance, the following sample request initiates a new backup:
curl -X POST \ ‘https://example.youtrack.cloud/api/admin/databaseBackup/settings?fields=archiveFormat,availableDiskSpace,backupStatus(backupCancelled,backupError(date,errorMessage),backupInProgress,stopBackup)’ \ -H ‘Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7’ \ -H ‘Content-Type: application/json’ \ -d ‘ < "backupStatus": < "backupInProgress": true, "stopBackup": false >>’
Pay attention to the headers in the request, and you can also provide a list of attributes in the fields request parameter to specify the attributes that will help you monitor the backup in the response that the server will return.
To the sample request above, server would return the following data:
< "archiveFormat": "TAR_GZ", "backupStatus": < "backupInProgress": true, "stopBackup": false, "backupError": null, "backupCancelled": false >, «availableDiskSpace»: 163739054080 >
Get the link to the backup
After you created a fresh backup, you can send another GET request to read an updated list of the backups.
The most important here is to specify the following attributes in the fields request parameter: creationDate,link,id .
For example, we send the following GET request:
curl -X GET \ ‘https://example.com/youtrack/api/admin/databaseBackup/backups?fields=creationDate,link,id’ \ -H ‘Accept: application/json’ \ -H ‘Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7’
In response to such request, the server returns the follwing group of JSON objects, sorted by the creation timestamp in descending order.
So, to download the fresh backup, we how need to take the link for the first returned backup entity: «link»: «backupFile/2020-05-22-13-14-07.tar.gz» .
Back Up the Database
To protect your installation against ransomware and recover from hardware or software failure, you should back up your YouTrack database on a regular basis. You should always have at least one recent, valid backup copy of your database that you can use to restore your installation.
To access your database management settings, open the Administration menu and select Server Settings > Database Backup .

You can back up YouTrack database right away or use a cron expression to back up the database on a set schedule (see cron expression syntax for reference).
There are several things to take note of regarding YouTrack database settings and controls:
- If YouTrack uses a built-in Hub service, YouTrack automatically switches the database to read-only mode when you start the database backup. This preserves the synchronization between the YouTrack and Hub databases. Users can still access and update issues in YouTrack, but most of the settings on administrative pages are read only. For best results, schedule backups outside of working hours.
- You can’t cancel the database backup once it has started.
- Notifications about the status of the database backup can only be configured for YouTrack application administrators.
Configure Backup Settings
You can modify the default settings of your database backup configuration.
To configure database backup settings:
Requires permissions: Low-level Admin Write
- From the Administration menu, select Server Settings > Database Backup .
- In the Backup Location field, set the location of the backup folder for your server.
- Set the Archive Format to determine whether the backup files are created as a TAR.GZ or ZIP archive. The maximum size of the ZIP backup file is 2Gb. For larger databases, use TAR.GZ archives.
- In the Notify about Failures drop-down list, select the users who receive notification messages about the database backups. To receive notifications for database backup, the user must also have the Low-level Administration permission.
- To configure automated backups, select the Enable regular backup check box. When you enable regular backup, the following settings are displayed:
- Backup Interval — Set the schedule for automatic backups. Select one of the pre-configured intervals or use a cron expression to set up a custom interval (see cron expression syntax for reference).
- Backup Files Rotation — Specify a number of the database backup files to keep. This parameter lets you create a rotation of database backups. Only the specified number of the backups files is kept on your server. To disable the automatic backup rotation, set the number to ‘0’ (zero). In this case, all backups files are kept and must be deleted manually. To delete a backup file manually, select the file in the list and click the trash button.
Restore Your Installation
One of the primary reasons for storing backups is to keep a valid copy of your data that you can use to recover from hardware or software failure. To keep your data safe, we strongly recommend that you enable regular backup of your database and test the process of restoring your installation.
For additional information and instructions, see the page that is relevant for your installation type:
- Restore a Docker Installation
- Restore a ZIP Installation
YouTrack Cloud Database Backups
Like the self-hosted version, YouTrack Cloud uses its own in-process database.
With a hosted instance, you cannot change the database location or restore your instance from a backup file. These operations are performed by the JetBrains YouTrack team. In the unlikely event that you need to restore your database from a backup, contact YouTrack support.
For each YouTrack Cloud instance, we automatically create and store the following database backups:
Stores a snapshot of the database for a specific day. When a new backup is created, the backup that is more than one week old is deleted.
One of the daily snapshots that was taken towards the end of the calendar week. When a new backup is created at the end of the week, the oldest weekly backup in the set is deleted.
One of the daily snapshots that was taken towards the end of the calendar month. When a new backup is added to this set at the end of the month, the oldest monthly backup in the set is deleted.
Backups are created for each instance separately. This is an automated process that creates a backup for one instance then moves on to the next. As such, these instances are not backed up at a fixed time each day. If you find yourself in a situation where you want to restore your instance from a backup, the YouTrack support team can tell you which points in time can be restored to.
Database Export
In addition to an automatic backup, which is configured and maintained by the YouTrack team, you can create a backup copy of your database and download the archive to your local machine. Use this option when you want to import the data to a self-hosted YouTrack installation or for troubleshooting.
For more information, see Database Export.
Backup Policy for Inactive Instances
When your YouTrack license or subscription expires, your instance is considered inactive. Inactive instances are scheduled for deletion after a predefined period of time. For details, see Automatic Deletion of Inactive Instances.
When an instance is deleted automatically, we retain a backup copy of the database for up to six months. During this time, we can restore the data to another active instance or send a copy of the latest backup files upon request. After six months, we delete the backup. It is no longer possible to restore the instance using our copy of the database.
Restore a ZIP Installation
To restore your database from a backup successfully, the version of the backup file should be the same or earlier than the version of YouTrack to which you restore this database.
Before you begin, make sure you have a backup copy of the database that you want to restore. Note the location of the backup copy so you are sure to select the correct file during this procedure.
If you don’t have valid backup files or your backup files are out of date, follow the instructions to Restore the Current Version Without a Database Backup.
- If you’re rolling back to the previous installation version after an unsuccessful upgrade, use the backup that you created prior to installation. If you ignored this prerequisite, locate a backup file that corresponds with the version of your previous installation.
- If you’re attempting to restore the current installation, locate an archived backup file in the directory that is set as the Backup location that corresponds with the current version of your installation.
Restore an Installation from a Backup Copy of Your Database
To restore your database to the current or previous version, you need to reinstall YouTrack and use the backup as the Upgrade Source during installation.
When you restore to a previous version of YouTrack, use a backup that corresponds to the version of the product that you want to restore.
To restore your database from a backup:
Requires permissions: Low-level Admin Write
- Stop the YouTrack service. For detailed instructions, see Stop and Restart YouTrack.
- Remove the directory. The directory is the location where the ZIP distribution was unpacked during installation. If the backup copy of the database that you want to use to restore your installation is located in this directory, move it to another location.
- Download and install a YouTrack build that is the same version or later than the version of your database backup. For detailed instructions, see ZIP Installation.
- In the Configuration Wizard , select the Upgrade option.
- On the Select Upgrade Source page, select your backup as the Upgrade Source and click the Next button.
- Confirm or change the locations where YouTrack stores product data. When done, click the Next button.
- YouTrack starts with the data from the backup file.
Restore the Current Version Without a Database Backup
There are a few cases where you are unable to restore your installation from backup.
- Your backup files are missing or out of date.
- The backup files on your server became corrupted and are unusable.
You may also want to follow this procedure when, for example, you were able to recover your data following a server crash and there is information that was recorded in YouTrack that is not in your most recent backup files.
You can attempt to restore the current version of your installation using valid copies of your configuration and data files. This restoration procedure is only successful when your configuration and data files are not corrupted. You can restore to an earlier version of YouTrack only when you have copies of files that have never been used to start a later version of the product.
To restore your database without a backup:
Requires permissions: Low-level Admin Write
- Locate the most recent copies of your data and conf directories. By default, these directories are stored in the location where the ZIP distribution was unpacked during installation. Note that an administrator may have changed the location where YouTrack stores these files. The path to the current location of the database is stored in the data-dir parameter in the /conf/internal/bundle.properties file. You can also use copies of these directories that are stored in another location.
- Copy the conf directory and the hub and youtrack subdirectories of the data directory. Paste them into a single, empty directory.
- If your database is stored in the default location, you can copy these files from the location shown in the following image and structure the content of the new directory as shown on the right.

- If your database is stored in another location, reference the bundle.properties file to locate the data files and recreate the structure as shown on the right.

- If your database is stored in the default location, you can copy these files from the location shown in the following image and structure the content of the new directory as shown on the right.
- Compress the contents of the new directory into an archive file. You can use any filename.
- Make sure that the service user account you use to run YouTrack has full access to this directory.
- Stop the YouTrack service. For detailed instructions, see Stop and Restart YouTrack.
- Remove the directory. The directory is the location where the ZIP distribution was unpacked during installation. If the backup copy of the database that you want to use to restore your installation is located in this directory, move it to another location.
- Install a YouTrack build that is the same version or later than the version of your database.
- In the Configuration Wizard , select the Upgrade option.
- On the Select Upgrade Source page, select the archive file that you created in step 3, then click the Next button.
- Confirm or change the locations where YouTrack stores product data. When done, click the Next button.
- YouTrack starts with the data from the configuration and data files.