Skip to content

Migrate to Bitiful

Bitiful is compatible with the S3 protocol, so most programs can switch over by changing just the Endpoint and keys. This page walks through a complete migration in order, with a focus on no downtime and no missing data.

PhaseWhat to doFeatures used
1. AssessIdentify the features you use, your data volume, and how files are accessedLimits, S3 API compatibility
2. PrepareCreate buckets, sub-users, and permissions, and set up public read and hotlink protectionBuckets, sub-users, access control
3. Move hot dataHave frequently used files moved over automatically on first accessMirror back-to-origin
4. Switch writes and readsPoint your programs at Bitiful and your read URLs at the new storageS3 SDKs, CDN domains
5. Fill in cold dataSync files that are rarely accessedRclone
6. Switch the CDN and certificatesPoint your domain's CNAME to Bitiful, with rules and certificates in placeCDN, edge rules, Certificate Center
7. Verify and retireCheck file counts and sizes, remove back-to-origin rules, and retire the old serviceRclone verification, Usage

Before you migrate, you can use the free tier to run a small directory through the whole process and confirm that your programs, tools, and access behave as expected.

1. Assess

Feature mapping

Feature you use on your current platformHow to do it on Bitiful
Standard, infrequent access, and archive storageThere's only one storage class, so put everything in the same bucket. There are no retrieval fees
Bucket Policy, ACLUse sub-user permissions to control program access, and public read and private to control anonymous access per directory
Referer hotlink protection, IP allowlists and blocklistsThe bucket's access control, or the CDN's edge rules
CORSCORS settings
Image processing serviceCoreIX processing parameters and styles. Parameter names need to be mapped and changed
Static website hostingStatic websites and domains plus the CDN
Back-to-origin, mirroringMirror back-to-origin, CDN custom origins
CDN rulesEdge rules. Cloudflare rules can be imported directly
Signed download linksPresigned URLs, or the CDN's advanced authentication

Lifecycle rules, server-side encryption, WORM, and versioning aren't supported yet. If your workload depends on these features, please evaluate alternatives first, such as having your program clean up expired files periodically, or encrypting files on the client before upload.

Data and access

  • Data volume and file count: These determine how you move data and how long it takes. If you have a very large number of files, we recommend running the sync tool on a cloud server.
  • Egress fees: Reading data out of your current platform usually incurs internet egress fees, so estimate them in advance.
  • Access patterns: Separate the parts accessed by programs through SDKs, the parts users access through links, and the parts delivered through a CDN, and plan the switch for each.
  • Object keys: Files whose keys contain ?, #, or % may not be fetched through mirror back-to-origin. Sync them separately with a tool.

2. Prepare buckets and permissions

Create buckets

Create one bucket for each of your original buckets. Bucket names are globally unique. See Bucket management.

Create sub-users

Create sub-users by program purpose, grant them access to the buckets or directories they need, then create AccessKeys. See Sub-users and AccessKeys.

Set up public read and access control

Set directories that were public to public read, then configure hotlink protection and CORS as needed.

Migrate processing rules

Rewrite your current platform's image processing parameters as CoreIX parameters, and save frequently used combinations as styles. To hide original images, turn on Original file protection.

3. Move hot data with mirror back-to-origin

With mirror back-to-origin, when a bucket can't find a file, it automatically fetches it from your current platform, returns it to the visitor, and saves it. Frequently used files are moved over automatically the first time they're accessed, with no downtime for your business.

  1. On the bucket's Mirror back-to-origin tab, add a rule, and set the origin to an address on your current platform that allows anonymous reads.
  2. Test with a file you know exists on your current platform, and confirm that it's returned correctly.
  3. If your current platform has hotlink protection or User-Agent restrictions, allow User-Agents starting with @Bitiful/MirrorServer, and allow empty Referers.

See Mirror back-to-origin.

4. Switch writes and reads

Programs

Change your SDK configuration to Bitiful:

SettingValue
Endpointhttps://s3.bitiful.net
Regioncn-east-1
Access Key ID / Secret Access KeyThe sub-user's keys

After the switch, new files are written directly to Bitiful. For examples in each language, see SDK overview.

Change file URLs in your pages and apps to your Bitiful CDN domain (or the bucket domain). If you already use your own domain, the change takes effect when you switch the CNAME in step 6, and the links themselves don't need to change.

5. Fill in cold data

Files that are rarely accessed won't trigger mirror back-to-origin, so you need to sync them with a tool. Taking Rclone as an example, add both your current platform and Bitiful to the configuration, then copy and verify:

rclone copy old:old-bucket s4:my-bucket -P --transfers 16
rclone check old:old-bucket s4:my-bucket --size-only

copy skips files that already exist, so you can run it multiple times. For how to configure your current platform, see Rclone · Migrate from other clouds.

6. Switch the CDN and certificates

Add a CDN domain

Add a CDN domain with the same name on Bitiful, and choose the new bucket as its origin. The domain needs an ICP filing, and you may need to verify domain ownership when you add it.

Prepare certificates

Request an auto certificate in the Certificate Center, or upload your existing certificate, then deploy it to the CDN domain and turn on HTTPS.

Migrate rules

Rewrite your existing cache, hotlink protection, authentication, CORS, and response header settings as edge rules. If you were using Cloudflare, you can import the rules JSON directly.

Verify, then switch the CNAME

Use curl --resolve or edit your local hosts file to request a few URLs first. Once you've confirmed that the content, response headers, and authentication are all correct, change the CNAME to the Bitiful address at your DNS provider.

After the switch, traffic moves over gradually as DNS caches expire, and the old and new CDNs serve requests side by side in the meantime. See CDN quickstart and Edge rules.

7. Verify and retire

  1. Use rclone check to confirm that file counts and sizes match.
  2. Watch Usage and Live logs for a few days to confirm there are no unusual 404s or 5xx errors.
  3. Delete the mirror back-to-origin rules.
  4. Stop writing to your current platform. Keep it for a while before deleting the original data and retiring the old service.

Until you delete the mirror back-to-origin rules, a file you've deleted from the bucket is fetched from the origin again the next time it's accessed. To delete a file for good, also delete it on your current platform, or remove the rules first.

Need help?

If you have a large amount of data to migrate or a tight schedule, feel free to contact support. We can help you evaluate your plan and estimate costs.