Developer's Diary
Software development, with Terry Ebdon
25-Feb-2020 BitBucket Migration

GitHub import tool

I discovered that GitHub has a tool to import repositories from other services. This includes BitBucket Mercurial repos! There's also a script to migrate BitBucket issues to GitHub issues.

BitBucket / GitHub issue migration

Installed Python 3 on my HP Desktop, as it's required by the Bitbucket Issues Migration script. I had some problems using this tool, but got there in the end. Due to my GitHub authentication setup I can't enter my passphrase at the tool's prompt. Instead I have to generate a GitHub Personal Access Token and use that. This failed; the migration script couldn't login. It needed more permissions, though this wasn't obvious from the 404 error it reported. Regenerating the P.A.T got it working. This is mentioned in the migration script's README.md, but could be more prominent. (Hard to blame them though!) I used the tool to migrate issues for WebDoxy and MindTools. It's not perfect, e.g. the auto-close messages don't tie the commit to the issue with a URL, as they did on BitBucket.

OSDN

I wasted a lot of time trying to get OSDN working with Hg before discovering GitHub's import facility. OSDN does look very interesting, but it's also very confusing. OSDN requires an SSH key to use Mercurial. It does not have a web interface for committing changes to repos, though it may have that feature on its "chambers". I haven't played with chambers yet.

I followed the GitHub instructions to generate an SSH key pair and add the public key to GitHub, i.e. not to OSDN. I then used OSDN's Key Import feature to import the key from GitHub. A roundabout way to do it, but far less confusing than following OSDN's instructions. In retrospect I'm sure I could have just pasted the key into OSDN. I still haven't got OSDN configured as a remote repo. With GitHub and BitBucket I can copy the repository URL and clone the repo. OSDN does show a URL but it doesn't let me copy it. I tried using the "F12" , developer screen, to copy the link but it didn't work for me. I suspect this is because I was trying to add it to an existing local repo as a second remote, instead of cloning the repo. But the second remote, with a commit hook to commit to both, should have worked. At least according to the Stack Exchange posting I "stole" the idea from. Also why is the URL greyed out and copy protected on the OSDN web interface? Very odd.

GitHub Desktop

I downloaded and installed GitHub Desktop. This is a 64-bit only tool, so will not work on my old MSI Wind U200. It's nice to have all the options available though.

Imports

I imported my "Dev Diary" blog repository into GitHub, from BitBucket. The source was a private repo, so GitHub prompted me for credentials. Nice! I then migrated the issues for that repo, there was only one. The commit that closed the issue does link to the issue. Interesting.

GitHub Problems

GitHub gave me an error when I tried to import OwToMarkDown from BitBucket. But the new repo has been created, with files and history. It's a small repository so I manually compared the history, for all five commits, and it looks perfect. I then tried importing the WebAdmin project, and things went downhill. I got an HTTP 500 error during import. The new repo exists but clicking on its name causes GitHub to prompt for my BitBucket credentials. Enter them and a 500 error appears. Checking the GitHub status page I see they're "experiencing an increased error rate".

Checked back later, GitHub have now fixed their problems.

Repo Migration Complete

Migration of all remaining repositories went smoothly. There's one repo that doesn't, yet, have it's single issue migrated. Once that's done I'll clone the repos to my HP Desktop and try building the ones I care about.

24-Feb-2020 👈 Top of page 👉 26-Feb-2020

© 2020 Terry Ebdon.

Find me coding on GitHub, networking on LinkedIn, answering questions on Stack Exchange and hanging out on twitter.