BlogHow we migrated our website to a new domain in just 3 hours

How we migrated our website to a new domain in just 3 hours

Over the weekend, we completed a significant milestone for Papermark: migrating our entire website and application from papermark.io to our new papermark.com domain.

When we started Papermark, we chose an affordable .io domain as a bootstrapped company with two founders. Like many startups, we believed the domain wasn't critical until the business gained traction. But as our open-source document sharing platform grew, we decided it was time to invest in our brand identity.

Domain migration process

What You'll Learn in This Article

We're sharing our journey from papermark.io to papermark.com through these key steps:

  1. Research and planning
  2. Deciding what to migrate
  3. Verifying the new domain in search engines
  4. Setting up the domain in Vercel
  5. Adjusting dependencies (S3 buckets & NextAuth cookies)
  6. Updating OAuth callback URLs
  7. Changing all domain references in the codebase
  8. Updating the sitemap
  9. Configuring environment variables
  10. Deploying the application
  11. Implementing permanent redirects
  12. Using Google Search Console for domain migration

The entire process took us just 3 hours to complete (with some preliminary steps like search console verification done a week earlier).

About Papermark

For those unfamiliar, Papermark is an open-source documents and data roooms sharing infrastructure. We are building a modern alternative to DocSend anda data room providers .

Papermark platform overview

Main Papermark use cases:

  • Founders share pitch decks with investors
  • M&A teams share documents with partners
  • Sales teams share proposals with customers
  • Venture capital teams share due diligence materials with portfolio companies and fundraise
  • Legal teams share contracts with clients

Learn more about custom use cases and benefits here.

Main benefit: Advanced page by page analytics and link protection settings

Check out our project on GitHub: Papermark GitHub Repository
If you find it useful, we'd appreciate a ⭐!

Why Migrate from .io to .com?

The primary motivation was credibility and trust.

What started as a side project quickly gained traction when we realized companies were frustrated with outdated interfaces, slow websites, and overpriced fees for document sharing and data rooms.

As one of our early M&A customers told us, "this market is ripe for an 'open source' disruption." The domain upgrade represents our commitment to growing the Papermark brand.

While we're confident in this investment now, we would never have spent $20k on a domain on day zero.

Let's dive into the technical details of our smooth transition.

The Migration Process: Step by Step

Step 1: Research and Planning

Before making any changes, we researched domain migration best practices. We consulted with our network on Twitter, used AI tools for guidance, and compiled a comprehensive checklist.

Migration planning

Step 2: Deciding What to Migrate

Papermark consists of three main components:

  • Our marketing website
  • The user application
  • Shareable document links

After careful consideration, we opted for a unified approach—migrating everything to the new domain to ensure brand consistency and avoid user confusion.

Step 3: Verifying the New Domain in Search Engines

A week before the migration, we verified papermark.com in both Google Search Console and Bing Webmaster Tools. This crucial step ensured that search engines recognized our new domain and were ready to index it.

Domain verification in Google Search Console

Step 4: Adding the New Domain in Vercel

Next, we added papermark.com to our Vercel project settings. Vercel's user-friendly dashboard made this process straightforward, allowing us to configure our application to point to the new domain.

Adding domain in Vercel

Step 5: Adjusting Domain Dependencies

We updated all services and configurations tied to our domain:

  • S3 Buckets: We ensured all storage configurations pointed to the new domain
  • NextAuth Cookies: We adjusted cookie domains to work with papermark.com
// NextAuth configuration adjustment
export default NextAuth({
cookies: {
sessionToken: {
name: `papermark.com-session-token`,
options: { domain: "papermark.com", secure: true },
},
},
// Other configuration options...
});

Step 6: Updating OAuth Callback URLs

With the domain change, we needed to update our OAuth callback URLs for services like LinkedIn and Google. This ensured that user logins remained secure and functional.

// Google OAuth configuration update
{
"client_id": "YOUR_GOOGLE_CLIENT_ID",
"client_secret": "YOUR_GOOGLE_CLIENT_SECRET",
"redirect_uris": ["https://papermark.com/api/auth/callback/google"]
}

Step 7: Changing All Domain References

A critical step was updating all occurrences of papermark.io in our codebase and marketing content to papermark.com. This included hard-coded URLs, metadata, and social links.

Code updates

Step 8: Updating the Sitemap

To help search engines understand our new structure, we updated our sitemap with the new domain references. This was essential for maintaining our SEO performance during the transition.

<!-- Updated sitemap snippet -->
<url>
<loc>https://papermark.com/</loc>
<lastmod>2025-03-30</lastmod>
</url>

Step 9: Configuring Environment Variables

We updated all environment variables in Vercel to reflect the new domain, including API endpoints, OAuth settings, and third-party integrations.

# Vercel environment variable update
vercel env add NEXT_PUBLIC_DOMAIN papermark.com

Step 10: Deploying the Application

Once all configurations were updated, we deployed our application to test everything on the new domain before the official switch. We did experience a brief period of downtime when some custom domain links stopped working, requiring a quick rollback and fix.

Deployment process

Step 11: Implementing Permanent Redirects

To preserve SEO value and provide a seamless user experience, we set up 308 (permanent) redirects from the old domain to the new one. We chose 308 redirects over the traditional 301s because they better handle API redirects with POST requests—some browsers might change the HTTP method to GET when encountering a 301 redirect.

Step 12: Using Google Search Console Migration Tools

Finally, we utilized Google's Search Console domain migration tools to ensure a smooth SEO transition. We set up separate property moves for our app and marketing domains, allowing Google to properly transfer search rankings and history.

What's Next for Papermark?

With the migration complete, we're focusing on enhancing the user experience and growing our open-source community. The new domain represents our commitment to building a professional, trusted platform for document sharing.

If you're considering a similar migration or building something in the open-source space, we'd love to hear from you! Check out our evolving project at Papermark.

Papermark in action

Feel free to give us a star on GitHub if you found this walkthrough helpful. Happy coding!


More useful articles from Papermark