How to Migrate from Bitly to Dub
·OSSAlt Team
bitlydubmigrationurl shortenerguide
How to Migrate from Bitly to Dub
Bitly's free plan limits you to 10 links/month. Paid plans start at $8/month. Dub is the open source alternative — unlimited links, analytics, custom domains, team workspaces, and QR codes. Here's how to switch.
Step 1: Set Up Dub
Option A: Dub.co Cloud
- Sign up at dub.co
- Create a workspace
Option B: Self-hosted
git clone https://github.com/dubinc/dub.git
cd dub
cp .env.example .env
# Configure DATABASE_URL, NEXTAUTH_SECRET, etc.
pnpm install
pnpm dev
Step 2: Export from Bitly
- Bitly → Settings → Advanced → Data Export
- Or use the Bitly API:
curl -H "Authorization: Bearer YOUR_BITLY_TOKEN" \
"https://api-ssl.bitly.com/v4/groups/YOUR_GROUP/bitlinks?size=100" \
> bitly-export.json
Step 3: Import Links
Use Dub's API to create links:
const links = require('./bitly-export.json');
for (const link of links) {
await fetch('https://api.dub.co/links', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_DUB_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: link.long_url,
key: link.custom_bitlinks?.[0]?.split('/').pop() || undefined,
domain: 'yourdomain.com',
}),
});
}
Step 4: Set Up Custom Domain
- Dub → Settings → Domains → Add Domain
- Add DNS records (CNAME to Dub's servers)
- Existing short URLs use your custom domain
Step 5: Update Existing Links
If you have Bitly links embedded in emails, social posts, or documents:
- Option A: Keep Bitly active as redirect (Bitly links still work)
- Option B: Set up 301 redirects from old Bitly custom domain
- Option C: Update links to new Dub URLs over time
Cost Comparison
| Feature | Bitly | Dub.co | Dub Self-Hosted |
|---|---|---|---|
| Links/month | 10 (free) | 25 (free) | Unlimited |
| Basic plan | $8/month | $24/month | Free |
| Analytics | Basic | Detailed | Detailed |
| Custom domains | Paid | ✅ | ✅ |
| QR codes | Paid | ✅ | ✅ |
Compare link management tools on OSSAlt — analytics, custom domains, and pricing side by side.