Can't Import Existing Mercurial Repository after upgrade

Previously we were using a really old version of SCM Manager. After installing 3.5, I’m not able to import the old existing Mercurial repositories. When I try to import from dump without metadata on a .hg.tar.gz, the import fails and I get the following in the import log:

“Failed to import from bundle”

Configuration:
SCM Manager 3.5.0
Windows Server 2012
Java JDK-22

Any help would be greatly appreciated!

Ben

Hi @bens thank you for your post. We will have a look at it

1 Like

Hey @bens , could you tell us on what version you’ve created the export? And could you take a look inside the tar file? You should find a .hg directory there containing the data. Is that the case?

Hi @pfeuffer, our old version randomly had issues and all of the repositories disappeared from within SCM Manager. This was the reason we ended up trying the newest version. The repositories that I’m trying to import are just the directories that existed on disk and were never exported. I used 7 zip to tar and then gz the directory to try and get it into the desired compression. If I look inside of the .hg.tar.gz file I see the .hg.tar file. I’m guessing the way I’m compressing the file in two steps is an issue?

Please let me know if there is anything else you need from me in order to help me figure this out.

I’m not sure how the old directory structure looked in 1.x. To import a packed repository in 2.x, you need a GZipped tar file (...tar.gz) that contains the mercurial repository in a .hg directory. So if you look inside the tar file from your gz file there has to be a directory .hg first containing the further directories and files like store, branch, hgrc and so on. Maybe it’s just that you had to pack the directory containing the .hg directory from 1.x.

I’d love to hear if that helps.

The repository I’m trying to import is .hg.tar.gz here is what I see once I open it with 7zip and open the .hg.tar again:

When I first open .hg.tar.gz in 7zip I see the tar file:

Thanks for the insight. To create a tar file that can be imported in SCM-Manager, you need to create an archive that has an .hg directory at top level that contains all the files you now have on top level in the archive.

Another way might be to create an empty hg repository, search for the .hg folder inside the newly created folder in {scm-home}/repositories, replace the files with your old repository data and restart the server.