What to do with your Mercurial repos when Bitbucket sunsets support

526 comments

shenfy February 17, 2020

I fully support the migration to git. But deleting user repositories feels like a punch in my face. Yet we will have no choice but bow to your commands and migrate everything to github.

Like Nathan Davis likes this
clach04 February 17, 2020

As this thread is rather large and hard to search I ended up posting a readme to https://github.com/clach04/bitbucket_tools - I've linked to some tools that do work.

There is also another tool (https://github.com/clach04/bitbucket_tools/blob/master/dump_repos.py) in the repo that will export only. It exports more items (metadata, logo, issues, downloads) in a one-shot than any of the other tools. It would be nice to combine some of the tools but there are some incompatibilities in approaches. The following:

 

will migrate you somewhere and are known to work.

Like aprieto likes this
cbillington February 17, 2020

FWIW github's hg importer messes up the order of merge parents - it ends up looking like master was merged into feature branches instead of the other way around. This can make diffs of merge commits be completely useless unless you manually reason about which head was master at the time and diff to the right parent. So it's not great if you're converting a branchy repository.

hg-fast-export gets it right:


https://github.com/frej/fast-export/

 

If you use bookmarks in mercurial, hg-fast-export can't deal with them though. I made a tool that wraps hg-fast-export, first converting bookmarks to named branches so it can deal with them:

https://github.com/chrisjbillington/hg-export-tool

 

Sorry for the email notification spam if you already saw me post about this - as with another poster, my previous post was deleted.

philipstarkey February 18, 2020

@clach04 any chance you could to add my tool to your readme?

https://github.com/philipstarkey/bitbucket-hg-exporter

It's the only one that saves discussions (comments) on pull requests.

Like clach04 likes this
clach04 February 18, 2020

@philipstarkey done! I remember seeing a post that you were working on something, I missed the "its ready" post. Thanks for the ping :-)

I'll look forward to giving this a shot when I get some spare time.

devzendo February 19, 2020

If you're hosting Maven projects on Bitbucket, and are looking to convert them to Git and move them to Github, I have written a converter that will translate the pom.xml <scm>...</scm> block from Mercurial/Bitbucket to Git/Github. So, it'll translate:

<scm>
<url>https://bitbucket.org/foobarorg/reponame</url>
<connection>scm:hg:https://bitbucket.org/foobarorg/reponame</connection>
<developerConnection>scm:hg:https://bitbucket.org/foobarorg/reponame</developerConnection>
<tag>HEAD</tag>
</scm>

To:

<scm>
<connection>scm:git:https://github.com/foobarorg/reponame.git</connection>
<developerConnection>scm:git:git@github.com:foobarorg/reponame.git</developerConnection>
<url>https://github.com/foobarorg/reponame.git</url>
<tag>HEAD</tag>
</scm>

(preserving indentation as necessary).

It's available at https://github.com/devzendo/bitbucket-to-github-pom-scm and requires just perl 5.

Regards, Matt

Like DiGriZ likes this
Mike Walsh February 19, 2020

I've use https://github.com/new/import to convert several repositories so far.  It works well, all branches, history, etc, seem to be intact.  I then would import the repo back to bitbucket.  When you create a new BB repo there is a link at the top of the page to import.  It's worked well for me.  You'll need to turn off 2 factor in BB.

Like diverger likes this
Iesus February 28, 2020

Hey, you might want to change the following page:

https://bitbucket.org/product/version-control-software

because it still says Mercurial is supported without mention of you ceasing to support it.

diverger February 29, 2020

Bitbucket should consider giving the Mercurial users a option like "convert repo to Git", or it will push the mercurial users to Github successfully.

Like # people like this
luzi February 29, 2020

What an utterly careless move. How can you decide to do this without a tool to convert a repo in place?

Since I have to do everything myself, I follow many previous commenters' recommendation and move to github.

Byebye Bitbucket - and byebye trust in Atlassian. You have lost a well networked evangelist. I had recommended Atlassian products in the past - and won't anymore.

Like # people like this
DiGriZ March 1, 2020

There's no reason to use bitbucket anymore. Moving to GitHub, bye-bye.

Like # people like this
MVSS_Solutions March 5, 2020

I successfully migrated my hg repos to helix teamhub hg. Kept all my commits intact! Easy process just hg push and keep going were I was.

https://www.perforce.com/success/hth/helix-teamhub-free

Ben Farrall March 6, 2020

We used Lorenzo Mori's method to pull the HG repo out and create a GIT version. The HG repo's we had weren't too complex but it preserved things like tags and branches. 

devzendo March 11, 2020

Bye, everyone - I've successfully migrated everything to https://github.com/devzendo with the aid of Magnus Hovland Hoff's https://magnushoff.com/blog/kick-the-bitbucket/ 'Kick the Bitbucket' script (which did the job superbly), and the scripts I published (see earlier) to change .hgignore to .gitignore, and update Maven pom.xml SCM blocks.

I'm sad to say goodbye to Mercurial; I find it far easier to use than git. Git's user interface is brutally incoherent. Oh well..

On the plus side, since moving to Github, my projects have been found by other users, starred, and I've been contacted by interested users. It really is 'social code hosting'!

Thank you once more Atlassian, for hosting my code since Google Code closed. I wish you luck with this strategy.

Like # people like this
Friedrich Hagedorn March 11, 2020

@devzendo: It is possible to use github with mercurial via hg-git: https://foss.heptapod.net/mercurial/hg-git

While the development of hg-git is quite active sometimes its a little bit tricky to find a working set of versions for: hg, hg-git and dulwich. The last problem I had was that I can clone a github repo via https but I had an error on push via the https url. My workaround was to first clone the repo with git and then clone it again locally with hg.

Regardless of this workaround I like it very much to work on a github-repo with mercurial.

Like pombredanne likes this
Eric Green March 18, 2020

So our strategy was twofold:

1. Back up all repositories on Bitbucket to our local Mercurial server, which we've had for years.

2. Migrate all Mercurial repositories to Git on the industry leading Git platform, which is *not* Bitbucket.

3. Start looking for alternatives for Jira also.

We simply don't like to deal with vendors that actively delete our data, and prefer to deal with vendors that do not actively delete our data. Sorry.

Like # people like this
vorapoap March 20, 2020

Thanks Teamhelix

Byebye Bitbucket.

timarkh March 25, 2020

I'm a scientist, and, just like many other researchers, I have links to some of my Bitbucket mercurial repositories in academic papers, which are impossible to change. Regardless of whether I choose to move my repositories to another platform or to turn them into Bitbucket git repositories, a problem remains: the links in my papers will lead nowhere. I would really appreciate it if Atlassian at least added an option of permanently redirecting the old repository URLs to the up-to-date git versions of those repositories. That way, the old links will resolve to something, and Atlassian still won't have to bother with keeping mercurial stuff alive.

I created a suggestion in Atlassian JIRA here: https://jira.atlassian.com/browse/BCLOUD-20031 . Please upvote it if you think that solution would help you too.

Like # people like this
Zoltán Lehóczky March 25, 2020

The trick is that you need to delete your repos before Atlassian does: When you do this you can specify an URL to redirect to. Thus your repo URLs will continue to live as redirects.

Like # people like this
timarkh March 25, 2020

@Zoltán LehóczkyThanks for the tip! I didn't know that, and it looks like a solution. However, it's not clear if that redirect survives when the underlying repository is deleted by Atlassian. If that is the case, it would be nice if they stated that explicitly somewhere.

Like Nigel Whitaker likes this
philipstarkey March 25, 2020

@timarkh One option could be to delete your hg repository and create a new git repository with the same name (this is possible because it is what Atlassian tells you to do - they just leave the conversion step to you). If, like me, you are planning on moving your repository somewhere else, rather than converting it to a BitBucket git repository, then just place a readme.md file in your empty bitbucket git repository with a link to your new repository hosting for people to follow.

This way you maintain ownership of a repository at the location referenced by your papers, and can redirect visitors as appropriate via an arbitrary message you have control over (in the readme.md file)

Like timarkh likes this
Vlad Korobov March 25, 2020

@philipstarkey and @devzendo how to prevent history change on git repo?

Viral Savani March 26, 2020

@AmberVH Is there any updates in the Bitbucket's timeline for sunsetting the Mercurial support due to the evolving situation of Coronavirus?

We had to divert our team leading the support for Mercurial to Git migration to help with technicalities evolved due to Coronavirus outbreak. That is weeks if not months of time we couldn't dedicate to the migration. And now we are in a situation where we are cutting it too close with the June 1, 2020 deadline.

I assume different organizations are suffering from the same issue.

Any feedback is appreciated.

Thanks! Stay safe.

Like zed likes this
devzendo March 27, 2020

@Vlad KorobovSorry Vlad, I'm not quite sure what you mean here? Could you elaborate please?

 

@Viral SavaniIs there any way the community here could assist you and your team?

 

Stay safe,

Matt

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 1, 2020

Adding a filter option or an icon for the Mercurial repositories in the repositories list would be really useful.

 

Open your dashboard, expand the left navigation panel and click the 'Repositories' link. You will find the 'Repository type' filter there. Example:

repositories-filter.png

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events