How to Move Files with the Backblaze B2 Command-Line Tool
  • 20 May 2025
  • Dark
    Light

How to Move Files with the Backblaze B2 Command-Line Tool

  • Dark
    Light

Article summary

The Backblaze B2 Cloud Storage command-line interface (CLI) supports the b2 file copy-by-id command that you can use to copy a file from one bucket to another bucket.

The context for making this call in the CLI is as follows:

b2 file copy-by-id <sourceFileID> <destinationBucketName> <b2FileName>

The sourceFileID is the file ID of the file that you want to copy to the new bucket. 

There are two options to find a file ID:

  • Use the b2 ls --long b2://<bucketName> command in the Backblaze B2 CLI.
  • In the Backblaze web console, click the ā€˜i’ icon next to a file. The Fguid is the file ID for that file.

The following example shows you how to copy a file from one bucket to another bucket.

b2 file copy-by-id 4_z63e743dfd068c90f538d0b10_f209db5804cb3a4d0_d20191021_m232927_c001_v0001109_t0011 S3-SEDemo newfile.txt

Was this article helpful?