Skip to content
Now accepting Q2 projects — limited slots available. Get started →
Migration Service

Drupal Multisite to Next.js Monorepo Migration

Your 30 Drupal Subsites Break Every Time One Module Updates

  • Stop coordinating module updates across 30 subsites that share a codebase but serve different audiences with conflicting requirements
  • Eliminate the database-level data leakage risk that makes your Drupal multisite unauditable for FERPA or franchise compliance
  • Fix the 1.8-second TTFB that tanks your Core Web Vitals and costs you 23% of mobile traffic before the page even renders
  • End the talent hunt for developers who understand Drupal multisite + Paragraphs + entity references — a skillset that shrinks 18% year-over-year
  • Remove the architecture constraint that forces every tenant into the same security posture, blocking site-level pen tests and certifications
  • Kill the deployment ritual where one subsite's broken Views config cascades into downtime for unrelated departments or locations
  • Ship 95–100 Lighthouse scores with sub-300ms TTFB using Next.js ISR and edge rendering that pre-generates tenant pages on demand
  • Prove tenant isolation to auditors with Supabase PostgreSQL RLS policies that enforce database-level separation at the row level
  • Launch a new franchise location or university department by adding one config file and one database row — zero infrastructure provisioning
  • Replace 15–40 separate Drupal deployment sequences with one CI/CD pipeline that updates every tenant in 6 minutes, cutting DevOps time 80%
  • Hire from the 4.2M React developer pool instead of competing for 47K Drupal specialists who command 40% higher salaries
  • Run site-specific security audits and compliance checks without touching your main codebase or affecting other tenants' uptime

Drupal multisite was a clever idea in 2012. One codebase, shared modules, spin up a new subsite for each department, franchise location, or agency office. Universities ran 15–30 subsites this way. Government orgs pushed it even further.

Then reality set in.

Every module update becomes a coordinated deployment across all sites. A security patch for one subsite means downtime risk for all of them. Your School of Engineering wants a custom module that conflicts with the School of Business's theme. Your franchise in Denver needs different content workflows than the one in Portland, but they share a database configuration that makes isolation nearly impossible.

The architecture that saved you time in year one costs triple by year three.

The Specific Pain Points We See

  • Module update nightmares: A single drush updb cascades across every subsite. One broken hook takes down 20 sites simultaneously.
  • Theming inconsistency: Shared base themes drift apart as each site piles on overrides. Sub-branding turns into a war of CSS specificity hacks.
  • Database coupling: Shared tables mean one misconfigured migration can corrupt data across tenants. We've seen this happen to a state government portal running 40+ agency sites.
  • Performance ceiling: Drupal's server-side PHP rendering hits a wall at scale. TTFB of 1.5–2.5 seconds is common on multisite installs under load.
  • Talent scarcity: Finding Drupal developers who understand multisite architecture, Paragraphs, and custom entity references gets harder every year. React/Next.js talent is abundant by comparison.
  • Compliance and security: Shared codebases make site-level security audits nearly impossible — a dealbreaker for government and .edu compliance requirements.

What You Get: Next.js Monorepo with Tenant Middleware and Supabase RLS

The target architecture replaces your entire Drupal multisite with a single Next.js application using the App Router, a monorepo structure for shared and tenant-specific code, middleware for routing and authentication, and Supabase with Row Level Security for real data isolation.

How Tenant Middleware Works

Next.js middleware intercepts every request before it hits your pages. For a university, that looks like this:

/departments/engineering → tenant: engineering
/departments/business → tenant: business
/locations/denver → tenant: denver-franchise

The middleware extracts the tenant slug, sets the Supabase RLS context, and the page renders with only that tenant's data. No shared database queries leaking across departments. No separate deployments per site.

Your middleware.ts detects the tenant from the URL path or subdomain, sets an app.current_tenant parameter in the Supabase session, and every subsequent query automatically scopes to that tenant's data.

Supabase Row Level Security: Real Data Isolation

Every table — programs, faculty, events, news, pages — gets a tenant_id column. RLS policies enforce isolation at the database level:

CREATE POLICY "tenant_isolation" ON programs
  FOR ALL
  USING (tenant_id = current_setting('app.current_tenant')::uuid);

This isn't application-level filtering that a bug could bypass. It's PostgreSQL enforcing that a query from the Engineering department literally cannot see Business department records. For government sites handling sensitive data across agencies, that's exactly the isolation auditors want to see.

Monorepo Architecture

Using Turborepo, the codebase organizes into:

  • packages/ui: Shared component library with sub-brand theming via CSS custom properties
  • packages/config: Tenant configuration — logos, colors, navigation structures, feature flags
  • apps/web: The Next.js application with dynamic [tenant] routes
  • packages/db: Supabase client with RLS-aware query helpers

Each franchise location or department gets its own configuration file, not its own deployment. Add a new location by adding a JSON config and a row in the tenants table. No infrastructure changes.

Our Migration Process

Phase 1: Discovery and Audit (1–2 Weeks)

We map every Drupal subsite — content types, taxonomies, menus, URL aliases, media assets, user roles, and integrations. For universities, that means cataloging SIS connections, SAML SSO configurations, and CRM webhooks. For franchises, it's location finders, local SEO schemas, and booking integrations.

We enable Drupal's JSON:API and run paginated exports to understand the full data shape: /jsonapi/node/program?page[limit]=50&include=field_department,field_faculty.

For Drupal 7 sites (still common in government), we query MySQL directly since JSON:API isn't available:

SELECT n.nid, n.title, fdb.body_value, fds.field_subtitle_value
FROM node n
JOIN field_data_body fdb ON fdb.entity_id = n.nid
JOIN field_data_field_subtitle fds ON fds.entity_id = n.nid
WHERE n.type = 'program';

Phase 2: Data Architecture and Supabase Setup (1–2 Weeks)

We design the Supabase schema with proper normalization and tenant isolation baked in from the start. Drupal's entity-attribute-value storage gets flattened into clean relational tables. RLS policies are written and tested before any data lands.

Tenant configuration goes into a tenants table with columns for branding, feature flags, navigation, and integration credentials.

Phase 3: Next.js Application Build (3–8 Weeks)

This is where the bulk of development happens. We build:

  • Dynamic tenant routes: app/[tenant]/page.tsx, app/[tenant]/programs/[slug]/page.tsx
  • Middleware: Tenant detection, authentication, redirect mapping, locale handling
  • Shared components: Program finders with faceted search, faculty directories, event calendars, news feeds — all RLS-scoped
  • Admin interfaces: Tenant-scoped dashboards where department admins manage only their content
  • ISR configuration: revalidatePath for content updates without full rebuilds
  • SAML SSO integration: Critical for universities and government portals

We use AI-assisted development (Claude Code, Cursor) to accelerate Drupal Paragraphs-to-React component conversion, which typically handles 70–80% of straightforward content type mappings.

Phase 4: SEO Preservation and Redirects (1 Week)

This is non-negotiable. Universities accumulate thousands of backlinks over decades. Government sites have regulatory URLs that must stay functional.

SEO Preservation Strategy

We export every URL alias from Drupal — including /node/1234 paths that external sites inevitably link to. These get loaded into a redirect map that Next.js middleware processes on every request.

The middleware handles:

  • Path-based redirects: /school-of-business/mba-program/departments/business/programs/mba
  • Node ID redirects: /node/4521/departments/engineering/faculty/smith
  • Subdomain consolidation: business.university.eduuniversity.edu/departments/business
  • Canonical URL enforcement: Preventing duplicate content across tenant routes
  • Structured data injection: Department-specific JSON-LD schemas, LocalBusiness markup for franchise locations

We verify every redirect with automated crawls before go-live. Search Console gets submitted with the updated sitemap immediately. For .edu sites, organic traffic typically stabilizes within 2–3 weeks and improves within 6–8 weeks as Core Web Vitals gains take effect.

Timeline and Pricing

Scope Timeline Investment
Small (1–5 subsites, franchise) 4–8 weeks $50K–$100K
Medium (10–15 subsites, university) 8–12 weeks $150K–$300K
Enterprise (20–40+ subsites, government) 12–16 weeks $300K–$600K

Drupal 7 sites add ~20% due to MySQL extraction work. SAML SSO and SIS/CRM integrations add complexity on the upper end. Ongoing hosting on Vercel + Supabase typically runs $200–$500/month — a fraction of what you're paying for Drupal hosting infrastructure spread across multiple subsites.

The Bottom Line

Drupal multisite solved a real problem in its era. But maintaining 20 subsites on shared PHP infrastructure, with a shrinking talent pool and mounting compliance concerns, isn't a long-term plan. A Next.js monorepo with Supabase RLS gives you true tenant isolation, sub-second page loads, a developer experience people actually enjoy, and an architecture that scales by editing a config file instead of spinning up infrastructure.

One app. One deployment. Every tenant isolated at the database level. That's the migration worth making.

How It Works

The migration process

01

Discovery & Audit

We map every page, post, media file, redirect, and plugin. Nothing gets missed.

02

Architecture Plan

New stack designed for your content structure, SEO requirements, and performance targets.

03

Staged Migration

Content migrated in batches. Each batch verified before the next begins.

04

SEO Preservation

301 redirects, canonical tags, sitemap, robots.txt — every ranking signal carried over.

05

Launch & Monitor

DNS cutover with zero downtime. 30-day monitoring period included.

Before vs After

Drupal Multisite vs Next.js Monorepo + Supabase

Metric Drupal Multisite Next.js Monorepo + Supabase
Lighthouse Mobile 35-55 95-100
TTFB 1.5-2.5s <0.3s
New Tenant Spin-up 2-4 weeks 1-2 hours
Hosting Cost (20 sites) $2,000-$5,000/mo $200-$500/mo
Developer Experience PHP/Twig/Drupal hooks React/TypeScript/App Router
Data Isolation Application-level (leaky) PostgreSQL RLS (enforced)
FAQ

Common questions

How many Drupal subsites can be consolidated into one Next.js app?

We've consolidated up to 40+ subsites into a single Next.js application. Supabase Row Level Security handles complete data isolation between tenants at the database level — whether you're running 5 franchise locations or 30 university departments, each operates independently within one codebase and one deployment pipeline.

Will we lose SEO rankings during the Drupal multisite migration?

Not if you handle redirects properly. We export every Drupal URL alias and node path, build a redirect map in Next.js middleware, and verify every mapping before go-live. Universities typically see traffic stabilize within 2–3 weeks and improve within 6–8 weeks as the new architecture's Core Web Vitals gains kick in.

Can each department or franchise location have its own branding?

Absolutely. The tenant configuration system supports per-tenant logos, color palettes, navigation structures, and feature flags — all driven by CSS custom properties and a config file. Adding a new sub-brand means updating a JSON configuration, not building a new theme or spinning up a separate site.

How does Supabase RLS compare to Drupal's multisite database isolation?

Supabase RLS is stronger. Drupal multisite can share tables across sites, which creates real data leak risks. PostgreSQL RLS policies enforce tenant isolation at the database engine level — queries physically cannot return rows belonging to another tenant. That holds up under government and .edu compliance audits far better than application-level filtering ever will.

Does the migration work for Drupal 7 multisite installations?

Yes, though Drupal 7 requires direct MySQL extraction since JSON:API isn't available. We query field tables directly and transform the entity-attribute-value storage into clean relational schemas for Supabase. That adds roughly 20% to timeline and cost compared to Drupal 8/9/10 migrations that use the JSON:API.

What happens to SAML SSO and SIS integrations during migration?

We rebuild SSO integration using Next.js API routes and middleware, connecting to your existing identity provider. SIS pulls (Banner, PeopleSoft, Workday Student) get reimplemented as server-side API integrations with Supabase as the data layer. CRM webhooks map to Next.js API routes. Nothing gets left behind.

How long does a typical university Drupal multisite migration take?

A university with 10–15 department subsites typically takes 8–12 weeks: 1–2 weeks for discovery and data audit, 1–2 weeks for Supabase schema design, 4–6 weeks for the Next.js application build, and 1–2 weeks for redirect verification and go-live. Larger installations with 20+ subsites and complex integrations push that to 12–16 weeks.

Ready to migrate?

Free assessment. We'll audit your current site and give you a clear migration plan — no commitment.

Get your free assessment →
Get in touch

Let's build
something together.

Whether it's a migration, a new build, or an SEO challenge — the Social Animal team would love to hear from you.

Get in touch →