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.
| Phase | What to do | Features used |
|---|---|---|
| 1. Assess | Identify the features you use, your data volume, and how files are accessed | Limits, S3 API compatibility |
| 2. Prepare | Create buckets, sub-users, and permissions, and set up public read and hotlink protection | Buckets, sub-users, access control |
| 3. Move hot data | Have frequently used files moved over automatically on first access | Mirror back-to-origin |
| 4. Switch writes and reads | Point your programs at Bitiful and your read URLs at the new storage | S3 SDKs, CDN domains |
| 5. Fill in cold data | Sync files that are rarely accessed | Rclone |
| 6. Switch the CDN and certificates | Point your domain's CNAME to Bitiful, with rules and certificates in place | CDN, edge rules, Certificate Center |
| 7. Verify and retire | Check file counts and sizes, remove back-to-origin rules, and retire the old service | Rclone 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 platform | How to do it on Bitiful |
|---|---|
| Standard, infrequent access, and archive storage | There's only one storage class, so put everything in the same bucket. There are no retrieval fees |
| Bucket Policy, ACL | Use sub-user permissions to control program access, and public read and private to control anonymous access per directory |
| Referer hotlink protection, IP allowlists and blocklists | The bucket's access control, or the CDN's edge rules |
| CORS | CORS settings |
| Image processing service | CoreIX processing parameters and styles. Parameter names need to be mapped and changed |
| Static website hosting | Static websites and domains plus the CDN |
| Back-to-origin, mirroring | Mirror back-to-origin, CDN custom origins |
| CDN rules | Edge rules. Cloudflare rules can be imported directly |
| Signed download links | Presigned 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.
- 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.
- Test with a file you know exists on your current platform, and confirm that it's returned correctly.
- If your current platform has hotlink protection or User-Agent restrictions, allow User-Agents starting with
@Bitiful/MirrorServer, and allow empty Referers.
4. Switch writes and reads
Programs
Change your SDK configuration to Bitiful:
| Setting | Value |
|---|---|
| Endpoint | https://s3.bitiful.net |
| Region | cn-east-1 |
| Access Key ID / Secret Access Key | The sub-user's keys |
After the switch, new files are written directly to Bitiful. For examples in each language, see SDK overview.
Links
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-onlycopy 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.
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
- Use
rclone checkto confirm that file counts and sizes match. - Watch Usage and Live logs for a few days to confirm there are no unusual 404s or 5xx errors.
- Delete the mirror back-to-origin rules.
- 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.