Migrating Short Links Off Bitly Without Breaking QR Codes

2026-12-01来源 dev.toEnglish

I run Elido, a hosted URL shortener, so I should say up front that I have a stake in where you move your links. This checklist is written so it works for any destination, including staying put. The migration problem is the same whichever vendor you pick: a short link is a promise made to people you cannot reach anymore. It is printed on a menu, stuck on a box, embedded in a PDF someone saved in 2022. You cannot recall any of it.

So the goal is not "import the links". The goal is that every URL that has ever left your building still lands on the right page after the cutover, and that you can undo the cutover if it does not.

Here is the order I would follow, with the checks I would run at each step.

Step 0: Decide what can move at all

A short URL is a hostname plus a slug. You can only redirect it somewhere else if you control the hostname. That splits your links into three groups, and only one of them is a real migration.

Link type Who controls the hostname What happens on migration
bit.ly/slug Bitly Cannot move. Keeps resolving while Bitly allows it.
links.yourbrand.com/slug You, through DNS Moves: recreate the slugs, then repoint the CNAME.
A complimentary domain issued by the vendor The vendor Cannot move. Not renewed after you delete or downgrade, so it breaks on expiry.

For the shared-domain links, "migrate" is the wrong word. The honest goal is to stop creating new ones and keep an account alive for as long as the old URLs are in circulation. According to Bitly's help center (read for our own migration guide, accessed 2026-10-02), bit.ly links keep working after account deletion, but you can no longer edit or redirect them, and you lose their metrics.

This is where I will admit something a competitor comparison would hide: if most of your printed material uses the shared bit.ly domain, no tool, including ours, can rescue it. The only fix is to move future material to a domain you own, and to keep the Bitly account for the long tail. We wrote a longer Bitly migration playbook that goes through this split in detail.

If you have not got a branded domain yet, set one up before you need to leave. It is the cheapest insurance in this whole topic, and custom domains for short links covers the DNS and certificate side.

Step 1: Build the inventory

Skip this and every later step is guesswork. The inventory is a table with one row per published short URL. Mine has these columns:

  • slug and full short URL (with the exact case used in print)
  • destination URL, including query string and fragment
  • hostname, since one account often serves several domains
  • group or workspace, because forgotten groups are forgotten domains
  • tags and campaign name
  • lifetime click count and the date you read it
  • channel: print, email, PDF, social, app, QR
  • owner: a person, not a team

Where do you find all of it?

Links. With Bitly, use the API with a Generic Access Token and page through each group. GET /v4/groups/{guid}/bitlinks?size=100 returns a page of links plus a pagination.next URL, and an empty next means you are done.

TOKEN="your-generic-access-token" GROUP="your-group-guid" curl -s -H "Authorization: Bearer $TOKEN" \ "https://api-ssl.bitly.com/v4/groups/$GROUP/bitlinks?size=100" # follow .pagination.next until it comes back empty 

The dashboard export depends on your plan and covers only what is on screen, so I treat the API as the reliable route. Other shorteners have similar list endpoints, and the shape of the loop is the same.

Domains. Check your DNS zones, not only the vendor settings. Search every zone you own for CNAMEs that point at a shortener. Marketing teams create these and forget them.

QR codes. This is the hard one, and I come back to it below. A QR code is not in your link export as a separate thing. It is a link that someone rendered as a picture and sent to a printer. The inventory has to include where each code was printed, or you will not know which links are load-bearing.

Things that are not links. Bio pages and landing pages live at their own URLs and are usually not part of the link export. Note them separately.

If the move is tied to a website redesign, join the inventory to the website URL map first. Our guide on how to audit short links before a website migration covers how to match each short link's destination to the new page, so you do not migrate a link whose target is about to 404.

Two details that trip people up:

  1. Case. Bitly treats bit.ly/CustomWord and bit.ly/customword as different links, per its help center. Many other tools, including Elido, store slugs case-insensitively per domain. If your old account has two slugs that differ only by case, they will collide on import, and a naive "append -2" rule changes a public URL. Find those in the inventory with a case-folding pass before you import anything.
  2. Click history. Per-click events do not come out of Bitly's API. It returns time-bucketed counts, not individual clicks, so no importer can rebuild old referrers, countries or devices. Write down each important link's lifetime counter with the date now, and keep it beside the clicks your new tool counts from the cutover date.

Step 2: Find the printed QR codes, then triage them

A printed QR code has a property that makes migration unforgiving: the pattern encodes a URL, and the URL has a hostname. Whatever you do to your database afterwards, the pattern on the box does not change.

Which of these is your code?

  • Static code. The destination is in the pattern itself. Nothing to migrate, nothing to break, but also nothing to change and no scan count.
  • Dynamic code on your own domain. The pattern holds https://go.yourbrand.com/spring26. Move the DNS, recreate the slug, and the printed code keeps working.
  • Dynamic code on the vendor's domain. The pattern holds the vendor's hostname. It stays tied to that vendor. You can recreate the destination somewhere else, but the old pattern keeps pointing at the old host.

That last case is the one that produces reprints. Our post on dynamic vs static QR codes has a short framework for choosing between them, and a separate checklist for switching QR code providers without reprinting that records each exact URL before you touch DNS.

For triage I sort printed codes into three buckets:

  1. Safe: on a domain you own. These go through the normal cutover.
  2. Stuck: on the vendor's shared domain. Keep the vendor account alive, and decide whether any of them is worth reprinting. Usually a few are: packaging, signage, anything with a long shelf life.
  3. Unknown: codes you cannot trace. Scan a physical copy, read the encoded URL, and put it in the inventory.

Do the third bucket with an actual phone and an actual printout. I have seen a QR code in a PDF that pointed at a different hostname than the one the team believed they used.

One practical test for every code: scan it, and write down not only where you land, but the redirect chain. A code that goes through two vendors is a code with two points of failure.

Step 3: Rehearse the import

Create the links in the new tool before you touch DNS. The order matters: after the DNS change, a request for https://links.yourbrand.com/slug must reach a service that already holds that exact slug. Some tools work the other way round and copy a link across lazily on first click, which means a link nobody clicks during the transition may never be transferred. I prefer importing up front, because then the cutover is a pure routing change.

There are usually three ways in, depending on size:

  • A vendor-specific importer that takes an API token. Elido's Bitly importer carries slug, destination, title and tags per link, and adds an imported:bitly tag so you can filter and bulk-edit afterwards. The Bitly migration page walks through the form.
  • CSV or bulk paste in the dashboard.
  • The REST API, for scripted loads. In Elido that is a bulk endpoint taking up to 100 links per call, with success or failure reported per item.

What does not travel, in our importer and probably in any other: lifetime click counters, created dates, QR designs, bio pages and campaign configuration. Plan to recreate those by hand.

Two rules for the import itself:

Choose the conflict rule deliberately. When two slugs collide, tools typically offer suffix (promo-2), skip, or fail. Suffix is the default in ours, and it is the dangerous one for printed material, because it silently moves the second link to a URL nobody printed. If the printed slug must stay exact, use skip or fail and resolve each clash by hand.

Rehearse on a small group first. Import one group, then click through 20 links across your most valuable destinations. An afternoon of rehearsal is where you find colliding slugs, destinations with odd encodings, and UTM parameters that got stripped.

Run a spot check on the parameters. Pick 20 links with query strings and compare the stored destination to the exported one character by character. A redirect that keeps the path but drops ?utm_campaign= quietly breaks your attribution for months, and nobody files a bug for that.

Step 4: The DNS cutover

Only links on your own domain need this step. The mechanics are small, and the timing is where migrations go wrong.

TTL arithmetic

A DNS answer can be cached for as long as the record's TTL says (RFC 1035, section 3.2.1), so the worst-case stale window equals the TTL you had before the change. If your CNAME sat at 86400 seconds, visitors can keep reaching the old service for a full day after you flip it.

My schedule looks like this:

When What
D-2 Lower the TTL on the record to 300 seconds. Write down the current target value. That value is your rollback.
D-1 Confirm the lower TTL is being served. Run the rehearsal checks once more.
D0 Run the production import. Then swap the CNAME and add any verification record the new vendor wants.
D0 + 10 min Confirm the domain verifies and request a link over HTTPS.

Copy the old target out of your own zone file, not from a vendor's documentation. It is the one value you will need under pressure.

Our own flow has two DNS records: a TXT record for ownership verification and a CNAME to the edge hostname. The domain verifies when both resolve, so verification effectively completes at cutover, not before. If you would rather watch the whole sequence once before doing it live, our custom domain setup post shows the forms.

TLS is part of the cutover

A custom domain needs a valid certificate on the new service from the first request. With on-demand certificate issuance, the first visit may be the one that triggers it, so request one real link yourself right after the change, from outside your office network, before any customer does.

If you are on a CDN or a proxy that forces HTTPS before the request reaches the shortener, check for extra hops. Every hop is another place for a redirect loop, and a QR scanner on a bad mobile connection has little patience.

Step 5: 301 or 302 during the move

This is the decision people argue about, and the answer for the cutover window is short: use a temporary redirect while you move, and switch to a permanent one later only for destinations that will never change.

The reasoning comes from the HTTP spec. RFC 9110 says a 301 is heuristically cacheable, while a 302 is not cached by default. If you flip to 301 on day one and then need to roll back, every client that cached the answer keeps going to the old place, and you cannot reach into their browsers to clear it.

Some facts that shape the choice:

  • Bitly documents its own links as 301 redirects, so incoming traffic has historically seen a permanent redirect.
  • In Elido you pick 301, 302 or 307 per link. Our importer sets none, so imported links start as 302, which suits the cutover.
  • For QR codes that you expect to edit, 302 stays the right status for the life of the code, since the destination is meant to change.

After the soak period, select the stable links (a documentation page that will not move, say) and switch them to 301 in bulk. Filtering by the imported:bitly tag makes that a few clicks. For the SEO angle on where the difference actually matters, see 301 vs 302 redirects, and Google's redirect documentation is the primary source.

Where do competitors win here? Honestly, nowhere on the status code itself. Where an incumbent can win is track record: Bitly has run these redirects for far longer than we have, and a migration trades that history for whatever you gain elsewhere. I would not move a link whose only job is to survive untouched for a decade unless I had a reason beyond preference.

Step 6: Test from a terminal, not from a dashboard

Never trust a green dashboard. Request the real URL.

First, check DNS from a public resolver, not your office one:

dig +short CNAME links.yourbrand.com @1.1.1.1 dig +short TXT _elido-verify.links.yourbrand.com @1.1.1.1 

Second, look at one redirect without following it:

curl -s -o /dev/null -D - --max-redirs 0 https://links.yourbrand.com/SummerSale 

You want the status you chose and a location: header that matches your export. A 404 means the slug was not imported. A 200 means you are looking at a page, not a redirect.

Third, run every slug from the inventory through a loop. This assumes a two-column slug,destination CSV built from your export:

DOMAIN="links.yourbrand.com" fail=0 while IFS=, read -r slug dest; do out=$(curl -s -o /dev/null -w '%{http_code} %{redirect_url}' \ --max-redirs 0 "https://${DOMAIN}/${slug}") code=${out%% *}; loc=${out#* } case "$code" in 301|302|307) ;; *) echo "BAD STATUS $code $slug"; fail=$((fail+1)); continue;; esac [ "$loc" = "$dest" ] || { echo "MISMATCH $slug -> $loc (want $dest)"; fail=$((fail+1)); } done < slugs.csv echo "failures: $fail" 

A trailing-slash mismatch is cosmetic. Fix the comparison, not the link. Run the loop an hour after cutover, the next morning, and a week later. Case matters, so test each active channel's exact spelling by hand, the mixed-case one printed on the flyer included.

If you want a quick look at a single chain without writing shell, our link checker tool shows each hop.

QR-specific tests

The curl loop proves the server side. It does not prove the print side. For QR codes add:

  1. Scan a physical printout with at least two phones, one iOS and one Android, on mobile data rather than Wi-Fi.
  2. Scan from the distance the code is meant to be scanned from. A code that works at 20 cm on your desk may not work from a doorway.
  3. Check that the redirect is one hop and the page loads fast enough that a scanner does not give up. Count the hops in your chain, not just the final status.
  4. Confirm the scan is counted in the new analytics. It is easy to cut over cleanly and then find out the click counter has been silent for a week.

A sign-off list for someone else to run

Have a person other than the engineer sign off against these:

  • Imported plus skipped plus failed equals the filtered export.
  • Every failed row is fixed, or consciously dropped with a reason.
  • 50 sampled links kept their UTM parameters.
  • The top 20 links by lifetime clicks pass a manual click-through.
  • At least one printed QR code scans.
  • Redirects are one hop on valid HTTPS.
  • The old lifetime counters are saved with a date.

If the migration is part of an agency handing a client account over, the same list needs ownership questions on top: who can manage the workspace, who renews the domain. We keep a separate short link handover checklist for agencies for that.

Step 7: Watch, then catch rot early

The first week after cutover is when you find out what the inventory missed. I watch three things.

404s on the new service. A request for a slug that does not exist means a printed link nobody listed. Log these. Each one is a missing inventory row, and you can usually add the slug and fix it within minutes, which is why the old account stays alive during the soak.

Click dips. Compare daily clicks to the same weekday before the cutover. A smooth cut shows no step change. Annotate the cutover date on every chart so nobody mistakes the missing history for a drop.

Destination rot. Migrations are when you discover that some destinations died long ago. Links rot, and short links feel it more because nobody looks at them. In Elido a cron job walks active links once every 24 hours and sends a HEAD request to each destination, following up to three redirects, with failures listed in a broken-links view and a link.broken webhook event. That catches dead pages and unreachable hosts. It does not catch a parked domain that answers 200, because we check status only, not content. I wrote up what is covered and what is not in our link rot prevention post, including the gaps. Whatever tool you use, ask the vendor how often destinations are checked and what counts as a failure.

For campaign-critical links, compare click-through to conversions, and open the final destination yourself once a quarter. A dashboard saying "healthy" is a status code, not a person reading the page.

Step 8: Rollback, and cancel the old account last

You can roll back until you cancel the old vendor. Agree the trigger before the cutover so nobody argues about it under stress. Mine is something like: an unexplained click drop above 30% for two days, or any broken link in the top 20.

The rollback action is to put the old CNAME target back. With a 300-second TTL most resolvers follow within about five minutes. Because you stayed on 302 during the soak, there are no cached permanent redirects pointing the wrong way.

Two things to do before you roll back:

  • Export the links created on the new service after cutover. They do not exist at the old vendor, and you will want to recreate them.
  • Note which links broke and why. A rollback without a postmortem just delays the same problem.

What breaks if you cancel too early

Order of operations is everything. From Bitly's help center, as I read it for our guide:

  • bit.ly links keep working after account deletion and the slugs cannot be reused, but you cannot edit or redirect them and the metrics are gone.
  • Custom-domain links keep working only while your DNS still points at Bitly. Bitly stops renewing the certificate, so visitors eventually see a "not secure" warning.
  • A downgrade, as opposed to a deletion, blocks creating new links on that domain.
  • Complimentary domains are not renewed, so links on them break at expiry.

So: move DNS first, confirm with the checks above, and cancel or downgrade last. I keep the old account for at least 90 days. On cost, Bitly's pricing page (accessed 2026-10-25) listed Core at $10 a month, labeled annual only, with 100 links and no custom domain, so the cheapest plan that holds your safety net may be smaller than you expect. Check the current page before you decide, since plans change.

The checklist in one place

  1. Split links into movable (your domain) and stuck (vendor domain).
  2. Build an inventory: slug, destination, host, group, channel, owner, lifetime clicks and the date.
  3. Find case-only slug collisions before the import.
  4. Trace printed QR codes with a real scan, and sort them into safe, stuck and unknown.
  5. Rehearse the import on one group. Choose skip or fail when the printed slug must stay exact.
  6. Lower the TTL to 300 seconds two days ahead. Write down the old target.
  7. Import first, then swap the CNAME.
  8. Stay on 302 through the soak, then move stable links to 301.
  9. Verify with dig and curl --max-redirs 0. Loop over every slug.
  10. Scan physical QR codes on mobile data.
  11. Watch 404s and click dips daily for a week.
  12. Keep the old account at least 90 days. Cancel last.

Where this leaves you

Most of the risk in a link migration is not technical. It is not knowing which URLs are out in the world. The inventory and the printed-code triage take longer than the import and the DNS change together, and they are the part that decides whether you get angry emails from a client about a dead menu.

If you want to try a rehearsal import without committing, the Elido pricing page lists what the free plan includes at the time you read it. If you run into an edge case this checklist does not cover, I would like to hear about it.

Oleksandr Tsoma is the founder of Elido, a hosted URL shortener with branded domains and QR codes. This article is about the migration problem, not only our product: the same steps apply to any move between shorteners.

原文:https://www.a8q9.cn/en/article/migrating-short-links-off-bitly-without-breaking-qr-codes-744443.html

相关文章