The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Added migration docs
Steven Tey5ec4c64e6c9a
diff --git a/components/app/modals/import-bitly-modal.tsx b/components/app/modals/import-bitly-modal.tsxindex a4f455cce5..63586a4b63 100644--- a/components/app/modals/import-bitly-modal.tsx+++ b/components/app/modals/import-bitly-modal.tsx@@ -20,6 +20,7 @@ import useSWR, { mutate } from "swr";import { BitlyGroupProps } from "#/lib/types";import Tooltip from "#/ui/tooltip";import { fetcher } from "#/lib/utils";+import { HOME_DOMAIN } from "#/lib/constants";function ImportBitlyModal({showImportBitlyModal,@@ -214,22 +215,30 @@ function ImportBitlyModal({</a></form>) : (- <Button- text="Sign in with Bitly"- variant="secondary"- loading={redirecting}- icon={- <img- src="/_static/icons/bitly.svg"- alt="Bitly logo"- className="h-5 w-5 rounded-full border border-gray-200"- />- }- onClick={() => {- setRedirecting(true);- router.push(bitlyOAuthURL);- }}- />+ <div className="flex flex-col space-y-2">+ <Button+ text="Sign in with Bitly"+ variant="secondary"+ loading={redirecting}+ icon={+ <img+ src="/_static/icons/bitly.svg"+ alt="Bitly logo"+ className="h-5 w-5 rounded-full border border-gray-200"+ />+ }+ onClick={() => {+ setRedirecting(true);+ router.push(bitlyOAuthURL);+ }}+ />+ <a+ href={`${HOME_DOMAIN}/help/article/migrating-from-bitly`}+ className="text-center text-xs text-gray-500 underline underline-offset-4 transition-colors hover:text-gray-800"+ >+ Read the guide+ </a>+ </div>)}</div></Modal>diff --git a/components/app/modals/import-short-modal.tsx b/components/app/modals/import-short-modal.tsxindex 133ef53003..ec2ffbdada 100644--- a/components/app/modals/import-short-modal.tsx+++ b/components/app/modals/import-short-modal.tsx@@ -19,6 +19,7 @@ import useSWR, { mutate } from "swr";import { ShortioDomainProps } from "#/lib/types";import Tooltip, { InfoTooltip, SimpleTooltipContent } from "#/ui/tooltip";import { fetcher, nFormatter } from "#/lib/utils";+import { HOME_DOMAIN } from "#/lib/constants";function ImportShortModal({showImportShortModal,@@ -140,14 +141,7 @@ function ImportShortModal({<div className="divide-y divide-gray-200">{domains.map(({ id, domain, links }) => (<div key={id} className="flex flex-col space-y-2">- <div className="flex items-center justify-between">- <p className="text-sm font-medium text-gray-700">Domains</p>- <Tooltip content="Your Short.io domain ID">- <p className="cursor-default text-xs uppercase text-gray-400 transition-colors hover:text-gray-700">- #{id}- </p>- </Tooltip>- </div>+ <p className="text-sm font-medium text-gray-700">Domains</p><div className="flex items-center justify-between space-x-2 rounded-md border border-gray-200 bg-white px-4 py-2"><div><p className="font-medium text-gray-800">{domain}</p>@@ -176,23 +170,6 @@ function ImportShortModal({checked={isSelected(domain)}/></div>- {/* <div className="flex items-center justify-between space-x-2 rounded-md py-1 pl-2 pr-4">- <p className="text-xs text-gray-500">- {tags.length} tags found. Import all?- </p>- <Switch- fn={() => {- if (selectedGroupTags.includes(guid)) {- setSelectedGroupTags((prev) =>- prev.filter((g) => g !== guid),- );- } else {- setSelectedGroupTags((prev) => [...prev, guid]);- }- }}- checked={selectedGroupTags.includes(guid)}- />- </div> */}</div>))}</div>@@ -237,8 +214,8 @@ function ImportShortModal({content={<SimpleTooltipContenttitle={`Your Short.io API Key can be found in your Short.io account under "Integrations & API".`}- cta="Learn more."- href="https://short.io/features/api"+ cta="Read the guide."+ href={`${HOME_DOMAIN}/help/article/migrating-from-short`}/>}/>diff --git a/content/help/migrating-from-bitly.mdx b/content/help/migrating-from-bitly.mdxnew file mode 100644index 0000000000..54bcff567e--- /dev/null+++ b/content/help/migrating-from-bitly.mdx@@ -0,0 +1,108 @@+---+title: Migrating from Bitly+updatedAt: 2023-08-02+summary: Easily migrate your links from Bitly to Dub in 2-3 clicks.+author: steventey+categories:+ - migrating+ - getting-started+related:+ - migrating-from-short+ - how-to-create-link+ - what-is-a-project+---++Bitly is a popular URL shortener that lets you create short links, which can be used in your marketing campaigns, social media posts, and more.++## How to migrate from Bitly to Dub++If you're looking to migrate from Bitly to Dub, we've built a custom migration tool that will help you migrate your links in just 2-3 clicks.++## Step 1: Sign in with Bitly++If you haven't already, [create a project on Dub](what-is-a-project#how-to-create-a-project).++<Note variant="info">+ **Protip**: Once you create your project, we generally recommend you **_not to+ [configure your domain](how-to-add-custom-domain)_** until you've migrated all+ your links. This will prevent any potential downtime for your links.+</Note>++Then, from your project dashboard, click on the `⌄` button next to the **Create Link** button and select **Import from Bitly**.++<Image+ alt="Import from Bitly button"+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/import-from-bitly-button.png"+ width={915}+ height={550}+/>++This will open a modal that prompts you to sign in with Bitly.++<Image+ alt="Import from Bitly modal"+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/import-from-bitly-modal.png"+ width={1017}+ height={676}+/>++In the sign in screen, click "Allow" and you'll be redirected back to Dub.++<Image+ alt="Signing in with Bitly"+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/sign-in-with-bitly.png"+ width={929}+ height={509}+/>++Behind the scenes, we'll fetch all your Bitly groups and their respective custom domains and number of tags. You'll be presented with a list of groups that we've found.++<Image+ alt="List of Bitly groups found for your account"+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/imported-bitly-groups.png"+ width={1087}+ height={718}+/>++<Note variant="info">+ If you accidentally signed in to the wrong Bitly account, you can click on the+ **Sign in with a different account?** link to sign in with a different Bitly+ account.+</Note>++Select the domains you want to migrate and choose if you'd like to import their respective tags as well. You can learn more about [how tags work on Dub](how-to-use-tags).++Once you're done, click **Confirm import**. In just a few seconds, all your links will be migrated to Dub.++<Image+ alt="Links imported from Bitly"+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/imported-bitly-links.png"+ width={1546}+ height={1063}+/>++Once all your links have been imported, we will send you an email to let you know that the migration is complete.++<Image+ alt="Email notification about completed Bitly migration"+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/imported-bitly-email.png"+ width={1126}+ height={708}+/>++Once you receive the email, you can [configure your domain](how-to-add-custom-domain#step-2-configure-your-domain) and start using your links!++## Which Bitly link attributes are migrated?++Bitly offers many features for its short links, such as link expiration, password protection, and more.++Here's a list of attributes that are migrated from Bitly to Dub:++1. Destination URL+2. Short link slug+3. Link creation date+4. Link [tags](how-to-use-tags)+5. Archived status+6. Link title (as part of Dub's [Custom Social Media cards](how-to-create-link#custom-social-media-cards) feature)++If there are any other attributes that you'd like to see migrated, please [send us an email](mailto:[email protected]?subject=Bitly%20migration%20feedback) and let us know!diff --git a/content/help/migrating-from-short.mdx b/content/help/migrating-from-short.mdxnew file mode 100644index 0000000000..a24bf2728a--- /dev/null+++ b/content/help/migrating-from-short.mdx@@ -0,0 +1,130 @@+---+title: Migrating from Short.io+updatedAt: 2023-08-02+summary: How you can migrate from Short.io to Dub in a few simple steps.+author: steventey+categories:+ - migrating+ - getting-started+related:+ - migrating-from-bitly+ - how-to-create-link+ - what-is-a-project+---++Short.io is a popular URL shortener that lets you create short links, which can be used in your marketing campaigns, social media posts, and more.++## How to migrate from Short.io to Dub++If you're looking to migrate from Short.io to Dub, we've built a custom migration tool that will help you migrate your links in a few simple steps.++## Step 1: Get your Short.io API key++First, log into your Short.io account and navigate to the [Integrations & API](https://app.short.io/settings/integrations/api-key) page.++<Image+ alt={`"Integrations & API" page in Short.io`}+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/short-api-page.png"+ width={1483}+ height={847}+/>++Click on "Create API Key", which will open up a modal. Leave all the options as default and click "Create".++<Image+ alt="API key creation modal in Short.io"+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/short-create-api-key.png"+ width={790}+ height={558}+/>++Copy the created API key. You'll need it in the next step.++<Image+ alt="Copy the created API key"+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/short-copy-api-key.png"+ width={675}+ height={310}+/>++## Step 2: Use the Short.io migration tool++If you haven't already, [create a project on Dub](what-is-a-project#how-to-create-a-project).++<Note variant="info">+ **Protip**: Once you create your project, we generally recommend you **_not to+ [configure your domain](how-to-add-custom-domain)_** until you've migrated all+ your links. This will prevent any potential downtime for your links.+</Note>++Then, from your project dashboard, click on the `⌄` button next to the **Create Link** button and select **Import from Short.io**.++<Image+ alt="Import from Short.io button"+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/import-from-short-button.png"+ width={915}+ height={550}+/>++You'll be prompted to enter your Short.io API key. Paste the API key you copied in the previous step and click **Confirm API Key**.++<Image+ alt="Import from Short.io modal"+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/import-from-short-modal.png"+ width={880}+ height={539}+/>++Behind the scenes, we'll fetch all your Short.io custom domains and their respective number of links. You'll be presented with a list of domains that we've found.++<Image+ alt="Domains found in Short.io and their respective number of links"+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/imported-short-domains.png"+ width={956}+ height={594}+/>++Select the domains you want to migrate and click **Confirm import**. In just a few seconds, all your links will be migrated to Dub.++<Image+ alt="Links imported from Short.io"+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/imported-shortio-links.png"+ width={1412}+ height={858}+/>++Once all your links have been imported, we will send you an email to let you know that the migration is complete.++<Image+ alt="Email notification about completed Short.io migration"+ src="https://d2vwwcvoksz7ty.cloudfront.net/help/imported-short-email.png"+ width={1132}+ height={690}+/>++Once you receive the email, you can [configure your domain](how-to-add-custom-domain#step-2-configure-your-domain) and start using your links!++## Which Short.io link attributes are migrated?++Short.io offers many features for its short links, such as link expiration, password protection, and more.++Here's a list of attributes that are migrated from Short.io to Dub:++1. Destination URL+2. Short link slug+3. Link creation date+4. Link expiration date (if enabled)+5. iOS device Targeting (if enabled)+6. Android device targeting (if enabled)+7. Archived status+8. Link title (as part of Dub's [Custom Social Media cards](how-to-create-link#custom-social-media-cards) feature)++Here are the attributes that are not migrated:++1. Password protection+2. Link tags+3. Link 404 URL+4. Link redirect type (Dub uses 307 redirects for all links)+5. Link cloaking (Dub only offers link cloaking for the root domain of your project)++If there are any attributes that you'd like to see migrated, please [send us an email](mailto:[email protected]?subject=Short.io%20migration%20feedback) and let us know!diff --git a/contentlayer.config.ts b/contentlayer.config.tsindex 909942bc21..16afcc318d 100644--- a/contentlayer.config.ts+++ b/contentlayer.config.ts@@ -111,6 +111,7 @@ export const HelpPost = defineDocumentType(() => ({"getting-started","link-management","custom-domains",+ "migrating","api",],default: "overview",diff --git a/emails/links-imported.tsx b/emails/links-imported.tsxindex 2c3848cdea..7a733a52ea 100644--- a/emails/links-imported.tsx+++ b/emails/links-imported.tsx@@ -139,10 +139,10 @@ export default function LinksImported({<Text className="text-sm leading-6 text-black">If you haven't already{" "}<Link- href={`https://app.dub.sh/${projectSlug}/domains`}+ href="https://dub.sh/help/article/how-to-add-custom-domain#step-2-configure-your-domain"className="font-medium text-blue-600 no-underline">- verified your domain{domains.length > 1 ? "s" : ""}+ configured your domain{domains.length > 1 ? "s" : ""}</Link>, you will need to do it before you can start using your links.</Text>diff --git a/lib/api/domains.ts b/lib/api/domains.tsindex 5692b0565e..b01fa7bd62 100644--- a/lib/api/domains.ts+++ b/lib/api/domains.ts@@ -246,11 +246,6 @@ export async function deleteDomainAndLinks(domain: string) {cloudinary.v2.api.delete_resources_by_prefix(domain),// remove the domain from VercelremoveDomainFromVercel(domain),- // remove the domain from the database- prisma.domain.delete({- where: {- slug: domain,- },- }),+ // Note: no need to remove the domain from the Prisma since we have onDelte: CASCADE]);}diff --git a/lib/constants/content.tsx b/lib/constants/content.tsxindex a754eb44e3..d5dbe8261c 100644--- a/lib/constants/content.tsx+++ b/lib/constants/content.tsx@@ -1,6 +1,6 @@import { Logo } from "#/ui/icons";import { allHelpPosts } from "contentlayer/generated";-import { Globe, Link2, Settings, Webhook } from "lucide-react";+import { Globe, Import, Link2, Settings, Webhook } from "lucide-react";export const BLOG_CATEGORIES: {title: string;@@ -40,6 +40,7 @@ export const HELP_CATEGORIES: {| "getting-started"| "link-management"| "custom-domains"+ | "migrating"| "api";description: string;icon: JSX.Element;@@ -68,6 +69,12 @@ export const HELP_CATEGORIES: {description: "Learn how to use custom domains with Dub.",icon: <Globe className="h-6 w-6 text-gray-500" />,},+ {+ title: "Migrating to Dub",+ slug: "migrating",+ description: "Easily migrate to Dub from other services.",+ icon: <Import className="h-6 w-6 text-gray-500" />,+ },{title: "API",slug: "api",