Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-9781

Allow the Bitbucket Server Import Repo feature to import in bulk from another Bitbucket Server instance


    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • None
    • None
    • 7
    • We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Problem Definition

      While implementing BSERV-3555 addressed some of the Git repository import issues, customer could benefit from the ability of importing in bulk from another Bitbucket Server instance in case a customer is migrating instances.

      Currently the feature allows to import in bulk from Bitbucket Cloud and GitHub:

      Suggested Solution

      Include an option to import in bulk from another Bitbucket Server instance.


      What we do have is a small experimental (and, please note, unsupported) command line tool that will take a collection of repositories on disk, create the project/repositories and then push them to Stash*.

      It can do this iteratively so you can refine the project/repo names for each on-disk repository. This, of course, means you will need to clone your repositories from your other Bitbucket Server instance to a local disk first before you can run the command line tool.

      I realize it's not ideal for you but it does at least limit the grunt work you'd have to do on the Stash* end (creating the project, repositories and pushing).

      You can find the source to the project here https://bitbucket.org/atlassianlabs/stash-importer and the binary here https://bitbucket.org/atlassianlabs/stash-importer/downloads/stash-importer-0.1-distribution.zip

      There is a readme file in the binary distribution which explains how to use it.

      A recent test to use the tool with Bitbucket Server 5.0.1 revealed that the tool is currently able to create the repositories/projects as per the import.list but the actual push of the repos is not currently working so you will have to do the work manually. It fails as in:

      $ ./bin/stash-import.sh importlist http://localhost:7990 import.list
      Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
      Enter username for [http://localhost:7990]: admin
      Enter password for [http://localhost:7990]:
      Importing repositories from import list "/path/to/import.list"
      Importing repository in directory "path/to/stash-importer" into repository stash-importer of project STASHIMPORTER
      Created project "STASHIMPORTER"
      Failed to create Stash repository for repository "/path/to/stash-importer": Failed to create repository "stash-importer" in project "STASHIMPORTER": key not found: cloneUrl

      See How do I migrate from a private git server to Bitbucket Server without manually creating all the projects/repositories again?

      * this tool is an experimental one and was developed for Stash. Since then there were many new releases and the tool hasn't been maintained.

      Why this is important

      Whilst there is no way to BSERV-4586 - As an admin, I want to be able to export and restore projects or repositories individually, so that the metainformation (e.g. pull requests details) are preserved, providing this ability would help address at least part of the problem.

            Unassigned Unassigned
            tbomfim ThiagoBomfim (Inactive)
            17 Vote for this issue
            11 Start watching this issue