Hi
I have a bitbucket data-center server deployed on a Debian server.
I've been asked to deploy bitbucket data-center on our cluster. I did it using the helm chart provided by Atlassian.
Now I want to migrate my projects and repositories from my old instance to the new one (same data-center version 8.16.2 with a postgres base behind it).
To do this, I'd like to use the API described in the documentation
No problem with export api it works well.
curl --location 'https://git.xxx.xxx.xx/bitbucket/rest/api/1.0/migration/exports' --header 'Content-Type: application/json' --header 'Authorization: Basic XXXXXXXXXXXXXXXXX' --data '{"repositoriesRequest":{"includes":[{"projectKey":"MDCONF","slug":"*"}]}}'The file is generated. I copied it to my volume using "kubectl cp". The file size is 100 MB
My problem is to import the file in bitbucket.
Looking at documentation, I use the rest api/1.0/migration/imports but with failure 400 Bad Request
First try with relative path to the file
curl --location 'https://git.xxx.xxx.xx/bitbucket/rest/api/1.0/migration/imports' --header 'Content-Type: application/json' --header 'Authorization: Basic XXXXXXXXXXXXXXXXX' --data '{"archivePath":"Bitbucket_export_2.tar"}'{
"errors": [
{
"context": null,
"message": "Invalid import request, the archive 'Bitbucket_export_2.tar' could not be found",
"exceptionName": "com.atlassian.bitbucket.validation.ArgumentValidationException"
}
]
}
Second try with full path
curl --location 'https://git.xxx.xxx.xx/bitbucket/rest/api/1.0/migration/imports' --header 'Content-Type: application/json' --header 'Authorization: Basic XXXXXXXXXXXXXXXXX' --data '{"archivePath":"/var/atlassian/application-data/bitbucket/shared/data/migration/import/Bitbucket_export_2.tar"}'{
"errors": [
{
"context": null,
"message": "Import archive location is invalid.",
"exceptionName": "com.atlassian.bitbucket.validation.ArgumentValidationException"
}
]
}
For the problem with the relative path, I checked my environment variables and $BITBUCKET_HOME is well set :
BITBUCKET_HOME=/var/atlassian/application-data/bitbucket
Looking at files, all seems to be ok :
How do I specify the archivePath to make the API work?
Thanks for your help
Antoine