YouTrack Disaster Recovery and Restore Procedure

1. Overview

This document describes how to restore YouTrack in case of complete server loss.

This procedure assumes:

  • The original YouTrack server is unavailable

  • A new clean server is provisioned

  • Backup archives are available on be5.dsp.byyd.me

  • Docker and nginx are not yet configured

This applies to Docker-based YouTrack deployments.

2. Backup Architecture

YouTrack generates nightly backup archives on:

logs.dsp.byyd.me:/opt/youtrack/backups/

A cron job synchronizes backup archives to the backup storage server:

be5.dsp.byyd.me:/backup/youtrack/current/

Only new or modified archives are transferred. Files on be5 are not deleted during synchronization.

Backup retention on be5 is 30 days.

3. Backup Location

Backup storage server:

be5.dsp.byyd.me

Directory:

/backup/youtrack/current/

Backup file format:

YYYY-MM-DD-HH-MM-SS.tar.gz

Example:

2026-02-25-02-00-00.tar.gz

4. Step 1 – Provision New Server

Install required packages:

apt update
apt install -y docker.io nginx certbot python3-certbot-nginx
systemctl enable docker
systemctl start docker

Ensure DNS track.dsp.byyd.me points to the new server IP.

5. Step 2 – Retrieve Backup Archive

Copy required archive from backup server:

scp be5.dsp.byyd.me:/backup/youtrack/current/<backup-file>.tar.gz .

Example:

scp be5.dsp.byyd.me:/backup/youtrack/current/2026-02-25-02-00-00.tar.gz .

Verify file integrity and size after transfer.

6. Step 3 – Prepare YouTrack Directories

mkdir -p /opt/youtrack/{data,conf,logs,backups}
cd /opt/youtrack

Move backup archive:

mv ~/2026-02-25-02-00-00.tar.gz backups/

Set permissions:

chmod -R 755 /opt/youtrack

7. Step 4 – Determine Correct YouTrack Version

Identify version used in production (from documentation or image history).

Example:

jetbrains/youtrack:2025.3.108430

Always use the same version for restore.

8. Step 5 – Start YouTrack Container

docker run -d \
  --name youtrack \
  -p 127.0.0.1:8080:8080 \
  -v /opt/youtrack/data:/opt/youtrack/data \
  -v /opt/youtrack/conf:/opt/youtrack/conf \
  -v /opt/youtrack/logs:/opt/youtrack/logs \
  -v /opt/youtrack/backups:/opt/youtrack/backups \
  jetbrains/youtrack:2025.3.108430

Verify container is running:

docker ps | grep youtrack

9. Step 6 – Restore Backup

Access YouTrack locally or via temporary SSH tunnel.

Select:

Restore from backup

Upload the backup archive and confirm restore.

Monitor restore process:

docker logs -f youtrack

Wait until restoration completes.

10. Step 7 – Configure Nginx (HTTPS Only)

Create nginx configuration:

/etc/nginx/sites-available/track.dsp.byyd.me

Configuration:

server {
    listen 443 ssl;
    server_name track.dsp.byyd.me;

    ssl_certificate /etc/letsencrypt/live/track.dsp.byyd.me/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/track.dsp.byyd.me/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:8080;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;

        proxy_read_timeout 3600;
        proxy_connect_timeout 3600;
    }
}

Enable configuration:

ln -s /etc/nginx/sites-available/track.dsp.byyd.me /etc/nginx/sites-enabled/

Test:

nginx -t

Reload:

systemctl reload nginx

If certificate is not yet issued:

certbot --nginx -d track.dsp.byyd.me

11. Step 8 – Validation

Verify:

  • All projects exist

  • Recent issues are present

  • Attachments open

  • Users can authenticate

  • Search works

  • No critical errors in logs

Check logs:

docker logs --tail=200 youtrack

Verify HTTPS endpoint:

curl -kI https://track.dsp.byyd.me

Expected response: HTTP 200 or HTTP 302.

12. Important Notes

  • Always use the same YouTrack version as original deployment

  • Never expose port 8080 publicly

  • All public traffic must go through nginx (HTTPS only)

  • Ensure sufficient disk space before restore

  • Verify DNS is updated before enabling nginx