Exporting

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

Before you start your export

Always carefully review the migration prerequisites before starting the export process.

Decide which project or repositories you want to migrate.

You will require project keys and repository slugs, which you can get from the URL of the repository.

Visiting an URL for a repository

The format is https://bitbucket.example.com/projects/PROJECT/repos/repository, where PROJECT is the project key and repository is the repository slug.

Previewing the export

Previewing allows you to experiment with the export request and returns a list of repositories that would be included with a given request.

You can perform a preview using the below command:

curl -s -n -X POST -H 'Content-type: application/json' -d '{"repositoriesRequest":{"includes":[{"projectKey":"*","slug":"*"}]}}' http://localhost:7990/bitbucket/rest/api/1.0/migration/exports/preview | jq .


The following request values are required for preview (REST Documentation):

説明
URL
/rest/api/1.0/migration/exports/preview
HTTP verb POST
HTTP ヘッダー Content-type: application/json
認証 Basic (基本)


To preview all repositories:

Request body
{
    "repositoriesRequest": {
        "includes": [ 
            {
                "projectKey":"*",
                "slug":"*"
            }
        ]
    }
}


To preview one full project and a specific repository:

Request body
{
    "repositoriesRequest": {
        "includes": [ 
            {
                "projectKey":"PROJECTKEY",
                "slug":"*"
            },
            {
                "projectKey":"PROJECTKEY2",
                "slug":"repository-slug"
            }
        ]
    }
}


If needed, you can specify the project key and slug pair as many times as necessary.  

As soon as you select one repository of a fork hierarchy, then every repository of that fork hierarchy will be exported, including personal forks and origins of the repository.

Performing the export

Once the export is started, an archive file will be written to disk containing all necessary Git data and database entities.

The archive file can be found after the migration is finished, in $BITBUCKET_SHARED_HOME/data/migration/export/Bitbucket_export_<Job ID>.tar


You can perform the export using the below command:

curl -s -n -X POST -H 'Content-type: application/json' -d '{"repositoriesRequest":{"includes":[{"projectKey":"*","slug":"*"}]}}' http://localhost:7990/bitbucket/rest/api/1.0/migration/exports | jq .

The following values are required for export (REST Documentation):

説明
URL
/rest/api/1.0/migration/exports
HTTP verb POST
HTTP ヘッダー Content-type: application/json
認証 Basic (基本)

Note: exactly the same request body as with previewing the export can be used.


To export all repositories:

Request body
{
    "repositoriesRequest": {
        "includes": [ 
            {
                "projectKey":"*",
                "slug":"*"
            }
        ]
    }
}


To export one full project and a specific repository:

Request body
{
    "repositoriesRequest": {
        "includes": [ 
            {
                "projectKey":"PROJECTKEY",
                "slug":"*"
            },
            {
                "projectKey":"PROJECTKEY2",
                "slug":"repository-slug"
            }
        ]
    }
}


You can specify the projectKey and slug pair as many times as necessary.  

As soon as you select one repository of a fork hierarchy, then every repository of that fork hierarchy will be exported, including personal forks and origins of the repository.


The response will contain the job ID, which is important to query the status of the job later.

During the export

You can query the following specific REST endpoint to see progress:

watch -n30 'curl -s -n -X GET http://localhost:7990/bitbucket/rest/api/1.0/migration/exports/<Job ID> | jq .'

Replace <Job ID> with the "id" value that was returned from request that started the export job.


The following values are required to query the progress (REST Documentation):

説明
URL
/rest/api/1.0/migration/exports/<Job ID>
HTTP verb GET
認証 Basic (基本)

エクスポート後

On completion, the job state will change to COMPLETED and the export file can be found in $BITBUCKET_SHARED_HOME/data/migration/export/Bitbucket_export_<Job ID>.tar. If any errors occurred, the job state will change to ABORTED for fatal errors or FAILED.

To check for warnings or errors:

curl -s -n -X GET http://localhost:7990/bitbucket/rest/api/1.0/migration/exports/<Job ID>/messages | jq .


Replace <Job ID> with the "id" value that was returned from request that started the export job.

警告またはエラーを確認するには次の値が必要です (REST ドキュメント)。

説明
URL
/rest/api/1.0/migration/exports/<Job ID>/messages
HTTP verb GET
認証 Basic (基本)

個々の場合に応じた警告メッセージへの対応が必要ですが、一般に、エクスポートされなかったデータがあるが、アーカイブは別のインスタンスへのインポートに使用できることを意味します。

エラー メッセージは一般に、生成されたアーカイブが使用不能であることを意味します。詳細は、トラブルシューティングのセクションを参照してください。

エクスポートのキャンセル

リクエストの受け入れと実際のジョブ キャンセルとの間に若干の遅れが生じる場合があります。ほとんどの場合、この遅れは無視可能な大きさです。

クラスタ全体に通信の問題が発生した場合、ジョブのキャンセルに数秒間かかる場合があります。

ジョブのキャンセルが正常に完了したことを確認するために、クエリを常に実行してジョブのステータスを問い合わせることをおすすめします。

エクスポート アーカイブはそのまま残りますが、インポートの実行に使用することはできません。これは問題の診断にのみ使用できます。 

エクスポートのキャンセル方法:

curl -s -n -X POST -H 'Content-type: application/json' http://localhost:7990/bitbucket/rest/api/1.0/migration/exports/<Job ID>/cancel

Replace <Job ID> with the "id" value that was returned from request that started the export job.

エクスポートをキャンセルするには次の値が必要です (REST ドキュメント)。

説明
URL
/rest/api/1.0/migration/exports/<Job ID>/cancel
HTTP verb POST
認証 Basic (基本)
最終更新日 2019 年 1 月 16 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.