swoodford / migrate_bitbucket_server_to_bitbucket_cloud Goto Github PK
View Code? Open in Web Editor NEWMigrate Atlassian Bitbucket Server to Bitbucket Cloud
License: Apache License 2.0
Migrate Atlassian Bitbucket Server to Bitbucket Cloud
License: Apache License 2.0
Is your feature request related to a problem? Please describe.
Currently the Cloud API throws an exception and the migration proccess fails if a project key contains a non-supported character like "-".
Describe the solution you'd like
There should be an option to sanitize project keys, in order to automatically convert dashes to underscores, or better, convert anything non supported to underscores.
Describe alternatives you've considered
Rename the projects before migration.
{
"type": "error",
"error": {
"fields": {
"key": [
"Project keys must start with a letter and may only consist of ASCII letters, numbers and underscores (A-Z, a-z, 0-9, _)"
]
},
"message": "Bad request"
}
}
Getting following error when running the script:
Begin cloudProject
{
"type": "error",
"error": {
"message": "Access token expired. Use your refresh token to obtain a new access token."
}
}
Command:
root@REDACTED:~/migrate_bitbucket_server_to_bitbucket_cloud# ./migrate.sh
============================================================
============================================================
============================================================
Beginning Bitbucket Migration
09-19-2018 14:38:50
============================================================
============================================================
============================================================
Begin migrateALL
============================================================
1 Project: REDACTED
Repo: REDACTED
Begin Local Backup
Switched to branch 'REDACTED'
Already up-to-date.
Switched to branch 'develop'
Already up-to-date.
Switched to branch 'master'
Already up-to-date.
Begin cloudProject
{
"type": "error",
"error": {
"message": "Access token expired. Use your refresh token to obtain a new access token."
}
}
Begin cloudRepo
Failure: Error checking if repo exists in Cloud:
Failure: Error creating repo in Cloud:
Failure:
Hey Dude
Thanks for your script, it really helped me and i saved a lot time to migrate my repos.
This is not actually a bug request, more of an improvement. Im not a bash specialist so i cannot make a PR with the fixes.
This two variables need to be present, otherwise following commands will fail:
LFSREPOS
MIGRATEDREPOS
Maybe helpfull:
Again, thanks for your work!
Kind Regards
Ales
Hi!
We seem to have an issue using this script, despite creating Oauth credentials according to your instructions (with all boxes ticked). The output is
Begin cloudProject
{
"type": "error",
"error": {
"message": "Forbidden"
}
}
migrate_bitbucket_server_to_bitbucket_cloud - migrate.sh
Paste verbatim output from Bitbucket Server Version between quotes below
Atlassian Bitbucket v5.1.0
Red Hat Enterprise Linux Server 7.5
Your script is a lifesaver!!! I appreciate all the effort that went into this. However, I'm having some issues with a phased migration.
When attempting to run the migrate.sh
script with migratePhases=true
, two issues present themselves:
PHASEFILE
variable does not work. Instead, I have to edit the phase1.txt
file. This is no big deal in practice, but I'm not sure why it's the case. Here's what I am using:# Migration can be done in one of three ways:
# Using Function migrateALL, will migrate ALL Projects and ALL Repos found on Bitbucket Server
migrateALL=false
# OR using Function migratePhases which is a plain text file containing a list of
# Project Keys and Repo Slugs separated by a TAB in the text file set in variable PHASEFILE
# This was designed to use values pasted from a spreadsheet with one or more rows containing projects and repo slugs
migratePhases=true
PHASEFILE="mob-repos.txt"
PHASENUMBER="1"
...still wants to use phase1.txt
.
# Git Checkout, Git Pull, Git Fetch on every branch in the repo
stage. I have the following set:# Username and password for Bitbucket Server account with Admin or System Admin level permissions on your Bitbucket Server
# This user must be able to read all Projects and all Repos in order to backup & migrate the entire server to cloud
SERVERAPIUSER="migration-user"
SERVERAPIPASS="migration-password"
I am not prompted for a password when running migrateALL=true
. This obviously presents a much more cumbersome issue. I am trying to find the root cause in the script, but it's a bit over my head.
Any help is appreciated!!!
migratePhases=true
mode recognizes PHASEFILE
and SERVERAPIPASS
variables
migratePhases=true
mode does not recognize PHASEFILE
and SERVERAPIPASS
variables
migrate.sh
The API endpoints of Atlassian have changed. Replace the /teams/ part of the url with /workspaces/ in order to make the script functional again.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.