How to migrate existing Bamboo artifacts to an AWS S3 bucket or to an SFTP server
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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.
*Except Fisheye and Crucible
Summary
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.
Environment
Bamboo server with access to AWS S3 buckets or an SFTP server
Locally stored artifacts of BambooRemoteArtifactHandler or ServerLocalArtifactHandler types
Solution
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
Go to "Bamboo Administration" >> "Artifact Handlers"
Configure the S3 Artifact handler Bucket settings; you can choose to:
Use the same AWS credentials as the Elastic Bamboo (EC2)
Specify different AWS credentials
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
When copying the files, make sure to copy the whole folder names recursively such as "
plan-1234567/*
" to the S3 bucket's parent pathShutdown your Bamboo Instance and take a full database backup, including
<bamboo-home>
,<bamboo-install>
and the DatabaseModify the database so Bamboo will reference the artifacts on the S3 bucket:
Database Update Query
1 2 3
update artifact set link_type = 'com.atlassian.bamboo.plugin.artifact.handler.remote:S3ArtifactHandler' where storage_tag = '<storage_tag>';
Start Bamboo and disable the old Artifact handler (Agent-local artifact handler, Bamboo server artifact handler)
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
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
When copying the files, make sure to copy the whole folder names recursively such as "
plan-1234567/*
" to the SFTP server configured locationShutdown your Bamboo Instance and take a full database backup, including
<bamboo-home>
,<bamboo-install>
and the DatabaseUpdate the database so Bamboo will reference the artifacts on the SFTP remote path:
Database Update Query
1 2 3
update artifact set link_type ='com.atlassian.bamboo.plugins.bamboo-scp.plugin:sftpArtifactHandler' where storage_tag = '<storage_tag>';
Start Bamboo and disable the old Artifact handler (Agent-local artifact handler, Bamboo server artifact handler)
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
Was this helpful?