How to migrate existing Bamboo artifacts to an AWS S3 bucket or to an SFTP server

お困りですか?

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

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

The content on this page relates to platforms which are supported; however, the content is out of scope of our Atlassian Support Offerings. Consequently, Atlassian cannot guarantee support. Please be aware that this material is provided for your information only and you may use it at your own risk.

要約

This guide will show how to migrate your existing Bamboo artifacts to AWS S3 Bucket or to an SFTP server. This is particularly useful when your Bamboo server is running out of disk space and you are looking to reduce the impact on operations.

環境

  • Bamboo server with access to AWS S3 buckets or an SFTP server
  • Locally stored artifacts of BambooRemoteArtifactHandler or ServerLocalArtifactHandler types

ソリューション

This article requires changes to the Bamboo database. Make sure you have enough privileges and capability to proceed with DB changes before attempting any steps listed in this article.

Identify and take notes of the artifacts you wish to move

You need to identify the artifacts you wish to move. Locate the artifacts, and prepare for the copy and updated SQL statements beforehand. There may also be cases where you'd rather move everything to the new location, in this case, there is no need to follow the provided steps to identify the artifacts below.

  • Run a SQL select to link each artifact with its respective build located on the following KB article Disk space hotspots and cleanup best practices in Bamboo
    • The provided query will return the build key, size and location of an artifact folder
    • You may have to adapt it to your own requirements to have more/less information
  • Artifacts are located on:
    • Bamboo 7 and earlier: <bamboo-home>/artifacts
    • Bamboo 8 and later: <bamboo-home>/shared/artifacts (replace <bamboo-home>/shared with your <bamboo-shared-home> if running on a cluster with customer configuration)

Moving to an S3 bucket

  1. Go to "Bamboo Administration" >> "Artifact Handlers"
  2. Configure the S3 Artifact handler Bucket settings; you can choose to:
    1. Use the same AWS credentials as the Elastic Bamboo (EC2)
    2. Specify different AWS credentials
  3. Copy the artifacts manually to the S3 bucket's root folder. We are not going to get into the details of the copy process as this varies from customer to customer
  4. When copying the files, make sure to copy the whole folder names recursively such as "plan-1234567/*" to the S3 bucket's parent path
  5. Shutdown your Bamboo Instance and take a full database backup, including <bamboo-home>, <bamboo-install> and the Database
  6. Modify the database so Bamboo will reference the artifacts on the S3 bucket:

    Database Update Query
    update artifact 
    set link_type = 'com.atlassian.bamboo.plugin.artifact.handler.remote:S3ArtifactHandler'
    where storage_tag = '<storage_tag>';
  7. Start Bamboo and disable the old Artifact handler (Agent-local artifact handler, Bamboo server artifact handler)
  8. Try to access the artifacts. If you have the required AWS S3 bucket rights Bamboo will be able to access the artifacts from the S3 bucket.

Moving to an SFTP server

The Bamboo SFTP artifact handler is available on Bamboo 9.1 and later

  1. Configure the SFTP artifact handler
  2. Copy the artifacts manually to the SFTP remote location defined on the SFTP Artifact handler. We are not going to get into the details of the copy process as this varies from customer to customer 
  3. When copying the files, make sure to copy the whole folder names recursively such as "plan-1234567/*" to the SFTP server configured location
  4. Shutdown your Bamboo Instance and take a full database backup, including <bamboo-home>, <bamboo-install> and the Database
  5. Update the database so Bamboo will reference the artifacts on the SFTP remote path:

    Database Update Query
    update artifact 
    set link_type ='com.atlassian.bamboo.plugins.bamboo-scp.plugin:sftpArtifactHandler'
    where storage_tag = '<storage_tag>';
  6. Start Bamboo and disable the old Artifact handler (Agent-local artifact handler, Bamboo server artifact handler)
  7. Try to access the artifacts. If you have configured the required SFTP rights Bamboo will be able to access the artifacts from the SFTP server
最終更新日 2023 年 4 月 3 日

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

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