
A code repository is a file archive and repository hosting facility that stores source code and technical documentation of development projects. It’s available for public and private access. This tool is widely used by developers, software engineers, or programmers to work on software or website development projects, etc. GitLab Inc. is the open-core company that provides GitLab, the DevOps software that combines the ability to develop, secure, and operate software in a single application. Bitbucket Server (formerly known as Stash) is a combination Git server and web interface product written in Java and built with Apache Maven. It allows users to do basic Git operations (such as reviewing or merging code, similar to GitHub) while controlling read and write access to the code. Here are some related guides: How to unregister a GitLab Runner, how to install, register, and start GitLab Runner on Windows, how to uninstall GitLab from your Windows device, and Deploying and using Windows containers with Gitlab CI.
I would say GitLab and GitHub have the best user interface, and most developers prefer GitHub because it's more popular. However, teams using Jira benefit from having seamless integrations with the Atlassian ecosystem. GitLab has Continuous Integration/Continuous Delivery (CI/CD) and DevOps workflows built-in. GitHub enables you work with the CI/CD tools of your choice, but you'll need to integrate them by yourself. Bitbucket’s code hosting is solid, but the web experience is quite lacking. The code search is not supported, nor the File Finder, and this could be the reason you want to migrate amonst other things.
Import your project from Bitbucket Server to GitLab
The Bitbucket Server importer does not work with Bitbucket Cloud. The Bitbucket Cloud importer for that, and at the end of this guide, I will be discussing how you can import a repo from a different repository to Bitbucket Cloud. Before imports into the Bitbucket server can be successful, a Bitbucket administrator will have to ensure import success is enabled. Kindly follow these steps to have it done. In the Bitbucket Server in the Admin area,
– Click on Settings
– On General,
– Click on Visibility and access controls and
– Finally Import sources.
The following can be imported to the BitBucket Server. When importing, repository public access is retained. If a repository is private in Bitbucket, it’s created as private in GitLab as well.
- Repository description
- Git repository data
- Pull requests
- Pull request comments
Below are the steps to import your projects into GitLab. Sign in to GitLab, and Select New project
This will open the Create new project window. Select Import project as shown below.
Select Bitbucket Server. As you can see, you can import projects from a wide range of repositories


Enter your Bitbucket Server URL and your personal access token in order to access your Bitbucket account as shown in the image below. Upon entering ur personal access codes, and granting GitLab access to your Bitbucket account. You could click on List your BitBucket Server Repositories in order to select one.
Select the projects to import, or import all projects. You can filter projects by name and select the namespace for which to import each project.
As you can see below, I have selected a project to import from Bitbucket.
As you can see, the project import is pending and currently being imported.
Finally, the image below shows a successful import of our project from Bitbucket Server to GitLab.
Import your project from Bitbucket Cloud to GitLab
This process is different than importing from Bitbucket Cloud. Import your projects from Bitbucket Cloud to GitLab with minimal effort. The Bitbucket importer can import:
- Repository description
- Git repository data
- Issues
- Issue comments
- Pull requests
- Pull request comments
- Milestones
- Wiki
Log on to Bitbucket Cloud to start the project import. When importing, it is worth noting that references to pull requests and issues are preserved. Also, the repositories with public access will be retained. If a repository is private in Bitbucket, it’s created as private in GitLab as well. To proceed with this import, you will have to sign into GitLab.
On the top bar, select New (), and select New project/repository.
Next, you will have to select Import project.
Select Bitbucket Cloud. As you can see, you can import projects from a wide range of repositories.
Grant GitLab access to your Bitbucket account as shown in the image below. Upon granting access, a list of your BitBucket Cloud Repositories in order to select one.
Select the projects that you would like to import or import all projects. You can filter projects by name and select the namespace each project will be imported.
When importing, if the following error is prompted, here is how to resolve the issue: “Importing the project failed: Project namespace path can contain only letters, digits, ‘_’, ‘-‘ and ‘.’. Cannot start with ‘-‘, end in ‘.git’ or end in ‘.atom’, Path can contain only letters, digits, ‘_’, ‘-‘ and ‘.’. Cannot start with ‘-‘, end in ‘.git’ or end in ‘.atom’, Path must not start or end with a special character and must not contain consecutive special characters.”
As you can see, the state will change to pending and then complete.
As you can see, the migration to GitLab has succeeded (complete
).
Now, let’s click on the project to access it and to see if it was successfully migrated. As you can see from the image below, it was. Also, under the activities, you will see an entry of the user that imported a project.
Import to Bitbucket Cloud from a different Repository
Bitbucket provides an importer to grab a repository. This importer works if you have your code in CodePlex, GitHub, Google Code, SourceForge, Subversion, or another Git-based hosting site. However, if your hosting site doesn’t fall into one of these sources or you don’t have a URL to enter, you must convert your code to Git.
To import into Bitbucket Cloud, kindly follow the steps below. Access your Bitbucket account and click on import repository
from the Create a new repository page.
Select the Source of the code you want to import. Depending on the Source, the system asks you to provide some more information. Enter a Name for your new repository, Uncheck This is a private repository
if you want the repository to be public, Select the Repository type,
Note: If your organization has configured a personal access token to retrieve the repository via your Git client or the command line, then you may need to use it in lieu of your username/password within the Bitbucket importer.
If you wish to enter a description and allow forking etc, expand Advanced settings and fill out the rest of the page if necessary. When you are done, hit the Import repository button.
I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.