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.

Why are Hardware Manufacturers Web Sites and Documentation Like Black Holes?
Apple Music Service - The Swift U-Turn

Discussion

  • Commenter's Avatar
    claudio — August 6, 2015 at 9:53 pm

    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

  • Commenter's Avatar
    jammer — August 12, 2015 at 7:16 pm

    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.

  • Commenter's Avatar
    Steve — January 31, 2016 at 2:41 pm

    @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.

  • Commenter's Avatar
    jammer — February 3, 2016 at 8:10 am

    @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!

  • Commenter's Avatar
    joe — February 11, 2016 at 7:28 pm

    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.

  • Commenter's Avatar
    joe — February 11, 2016 at 7:29 pm

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

  • Commenter's Avatar
    Viral — March 21, 2016 at 9:13 am

    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.

    • Commenter's Avatar
      jammer — March 21, 2016 at 12:08 pm

      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?

  • Commenter's Avatar
    Viral — March 21, 2016 at 4:22 pm

    Hi Jammer,

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

    • Commenter's Avatar
      jammer — March 21, 2016 at 5:34 pm

      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 Comment

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.