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 apps 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 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
Pre-Migration Checklist
Full Bamboo backup — include
<bamboo-home>,<bamboo-install>, and the database. The article references this in step 5 but it must be done before any artifact copy operation.DB write privilege — you need permission to
UPDATEtheartifacttable. Verify your DB user can run UPDATE statements against the Bamboo schema before scheduling downtime.Storage validation — confirm S3 bucket / SFTP destination is accessible from all Bamboo nodes (server and remote agents). Bamboo accesses artifact storage at build-time, not just at migration-time.
Scheduled downtime window — this migration requires Bamboo shutdown. Plan a 1–4 hour window depending on artifact volume.
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>/artifactsBamboo 8 and later:
<bamboo-home>/shared/artifacts(replace<bamboo-home>/sharedwith 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
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 from a build summary-> Artifacts tab. If you have the required AWS S3 bucket permissions, Bamboo can access the artifacts in the S3 bucket.
Monitor the
<bamboo-home>/logs/atlassian-bamboo.logfile for any errors while accessing the artifacts.If you see errors or have trouble accessing the migrated artifacts, please contact Atlassian Support.
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
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
Monitor the
<bamboo-home>/logs/atlassian-bamboo.logfile for any errors while accessing the artifacts.If you see errors or have trouble accessing the migrated artifacts, please contact Atlassian Support.
Related articles
Disk space hotspots and cleanup best practices in Bamboo — the SQL query for identifying artifacts and their builds.
Configuring Elastic Bamboo — AWS credential configuration (referenced inline)
Configuring the SFTP artifact handler — a required prerequisite for the SFTP migration path
Was this helpful?