How do I transfer a project from H2 DB to Postgresql

codejunkyard July 5, 2018

The Hard-drive of the machine I was evaluating Jira with died shortly after I acquired a starter license. I setup my new production instance of Jira on a server with Postgresql DB. But now I want to transfer just a single project from the H2 DB evaluation install (I have managed to recover the files and can access the H2 database) without messing up my user accounts and everything else now on my Postgresql db. So I don't want to migrate wholesale, just a project. Can I do this?

1 answer

1 accepted

0 votes
Answer accepted
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 5, 2018

Steve,

 

You'll need to restore the original Jira instance in order to get your project back. It won't be possible to recover from the H2 DB directly.

For this, you have two options:

  1. You have a new installation of Jira, stop it, and in the dbconfig.xml file you can direct it to the H2 database that has the old data. This will recover the old Jira instance. From here you can export your desired project.
  2. You can restore the automatic backup from <Jira Home>/export on the old instance so long as you didn't disable automatic backups. You can do this on your new Postgres instance. This will restore the entire Jira instance, and if you only wanted the one project, it might require quite a bit of cleanup.

Please take the time to review this and let me know if you want any more details on either option.

Regards,

Shannon

codejunkyard July 6, 2018

Thanks Shannon, option 1 was simple enough .. but after pointing dbconfig.xml to my old database and restarting jira I can see my project, but I do not see any of the issues. I only copied the /var/atlassian/application-data/jira/database directory, I thought that would be enough for the entire contents of the old instances database.

Can you think of any reason I would see the project, but not the issues?

Cheers,

Steve

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 9, 2018

Steve,

I would first try reindexing Jira entirely and see if that helps your issue.

If not, it could be that dbconfig.xml isn't pointing to the right place. Can you check that it's now pointing to where you placed the H2 file exactly? 

If it is, then I would recommend checking the Jira server logs, as Jira might be having an other issue.

Regards,

Shannon

codejunkyard July 9, 2018

Thanks Shannon - All good now. I had various issues with not being able to login as sysadmin on my old instance but sorted it with some H2 DB hacking ;)

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 9, 2018

Glad to hear you got it sorted out!

Which suggestion was it? The indexing?

Shannon

codejunkyard July 9, 2018

Hi - your original response is what got me down the right path. I worked the indexing out for myself but hit a stumbling block with not being able to export the database because I wasn't logged in as sysadmin for which I needed to some database gymnastics - actually just copied the hashed password for a user I could login as into the sysadmin user entry.

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 10, 2018

Great, thank you for clarifying that! 

Take care and have a pleasant week, Steve.

Regards,

Shannon

Suggest an answer

Log in or Sign up to answer