• behance
  • gitHub
  • google
  • linkedin
  • twitter
Restoring YouTrack Backups

Restoring YouTrack Backups

I love JetBrains software, I really do.  How I’d get by without ReSharper is anyone’s guess but they are not issue free by any stretch.  There also seems to be some very odd issues with their documentation a lot of the time as well.  A real shame since considering how nice their products are and how easy they are to get going with the processes of migrating to new version can be a bit hit and miss – if you follow their docs.

A case in point is YouTrack.  I’ve just had to reinstall my server that runs my local instance of YouTrack.  Now an issue tracker for a developer is insanely important.  It will more often than not contain lots of hard earned intelligence not to mention priorities for work and ways for lots of disparate team members to communicate.

I was running YouTrack 5.2.5 and I had that configured to do automatic backups.  So looking at the JetBrains instructions on how to restore a backup looks remarkably straight forward (it is by the way just not how they describe!):

Skip to end of metadata

Important note
For successful restoring, version of the backed up database should be the same or older than the version of YouTrack, to which you restore this database.

To restore a database from a backup, proceed as follows:

  1. Download a backup tar.gz file via web UI from the Administration > Database Backup page or locate a needed backup file directly in the specified backup folder on the YouTrack server machine.
  2. Stop YouTrack server instance.
  3. Clean all content of the database location directory. By default, the database is located in the teamsysdata folder in the home directory of a user account, which starts YouTrack. You can change default database location, for more details please refer to the Changing Database Location page.
  4. Extract the downloaded backup file to your database location.
  5. Start YouTrack.

The instructions I’m about to write below work for 5.x and 6.x (I’ve tested these on both versions and they work).

Firstly the backups I have generated from YouTrack are not tarbals, they are .zip files, this is configurable in YouTrack but I cannot find anything on the JetBrains site that details the process for zips so I can only assume that either configuration will result in a file that contains the same data.  Anyway, I digress.

So mistake number one, no mention of zip files.

The Solution

In step three is says – Clean ALL contents of the database directory.  DO NOT DO THIS!!  If you delete all the files in there as suggested and then dump the contents of your backup ZIP into the directory, it doesn’t work.  At least it didn’t for me.  Also the teamsysdata directory they mention in this article referrd specifically to YouTrack 5.x yet this article was written in 2012 and is also part of the 6.x documentation.  YouTrack 6.x is vastly different to 5.x and does not use the same structure for the database at all.

What I do (and always works for me) is:

  1. Logout of YouTrack
  2. Stop the YouTrack service
  3. Remove the existing 00000000000.xd file from your YouTrack database directory (your file name maybe slightly different)
  4. Copy over your backup *.xd files into the database location – mine were called (00000010g00.xd, 00000010o00.xd, 00000011000.xd)
  5. Copy over your blob directory into the existing blob directory
  6. Leave all the other files in place and untouched
  7. Restart the YouTrack service
  8. Login under the root account
  9. You should now see your restored issues

Personally I don’t understand how a company that makes such great things as ReSharper can make such glaring issues in their documentation.  Certainly when it refers to something as important as restoring backups of your hard earned intelligence.

Anyway, I hope this helps and clears up some confusion surrounding this issue.  JetBrain, if you are listening please sort this out.

Share

11 Comments

  1. avatar
    claudio · August 6, 2015 Reply

    hi Jammer,
    i dont understand the JetBrains too. I feel like the youtrack not receive the attention that it needs.
    I installed the youtrack in a new server and tried to move my configuration and issues to the new server, but the documentation did not help me (like you). I found your post and tried your method, but the result is that youtrack always redirected me to the old server. Have you ever seen this before? Have any clue or solution?? Thanks

  2. avatar
    jammer · August 12, 2015 Reply

    Indeed a lot of their documentation is a bit lacking as far as I’m concerned. Or it’s plain wrong.

    I have seen the issue you’re reporting when I first restored mine but it only happened once and then all was well again which is a bit odd.

    I’m not sure I can offer any advice on this one. I’ll have a think about it though and see if I can find a solution for you.

  3. avatar
    Steve · January 31, 2016 Reply

    @claudio: the YouTrack database contains the settings as well. You are being redirected to your old YouTrack installation because your new YouTrack installation thinks that this is the URL you are accessing. To get around this, you’ll have to manipulate your hosts file.

    @jammer: thanks very much for this! I ran into this situation where it deleted all my blobs (aka file attachments) after restoring from backup. I would wager that YouTrack isn’t as an exciting product to work on so products like ReSharper and IntelliJ attract JetBrains’ A-team.

  4. avatar
    jammer · February 3, 2016 Reply

    @Steve, I can’t but agree!! And you are right about the redirect. Personally this whole area of YouTrack needs a LOT of attention. It’s too error prone and considering that it is one of the systems they use publicly to capture problems I’m surprised they haven’t done more work on. It’s not like it’s a new product!

  5. avatar
    joe · February 11, 2016 Reply

    I have had nothing but problems in the past 7 days with restoring a backup! I have a tarball that I’m trying to get going on a new version of YouTrack and their site says to do it as if you’re upgrading but it doesn’t work that way at all. I managed to put my data in the new running version but my Projects are not there and my google auth is also missing. All I can do is look at my issues that were created.

  6. avatar
    joe · February 11, 2016 Reply

    at this point I am ready to hire someone with YouTrack experience to get this thing working.

  7. avatar
    Viral · March 21, 2016 Reply

    Hi Jammer,

    I am too having issues. I am upgrading from YouTrack 6 build is 12223 to the latest version. I created new virtual machine, this creating fresh install then the idea to restore the database to the new server. The person who installed the current version installed the server in a way I wouldn’t want to upgrade to. The new server there is separation of the data drive etc. Followed you’re instructions and all I get is HTTP 404 error when copying over the files. Like you mentioned I am shocked of the lack of materials from Jetbrains. I am wondering if you know what I am missing out. Luckily enough I can go back to before I restore point of the import of the backup as I have taken snapshot of the virtual machine.

    • avatar
      jammer · March 21, 2016 Reply

      Are you sure you are using the same URL as the previous installation? There can be issues like this as the backed up files also include a kind of root URL and there can be issues when you try to access a page and the server and client are trying to do the OAuth token exchange. What is the URL that gives you the 404 error?

  8. avatar
    Viral · March 21, 2016 Reply

    Hi Jammer,

    No it is different URL to the previous server? Is this where I am going wrong?

    • avatar
      jammer · March 21, 2016 Reply

      Quite possibly its where the 404 is coming from. The OAuth process actually bounces the browser around a little in order to get tokens and I expect you might be seeing this 404 since it’s trying to redirect based on the value stored in the database you have restored but due to the host changing this can longer be found … 404 error.

Leave a reply

*