Incremental migration
What you need to know
Incremental migration moves individual public routes from pages to app while preserving their URLs and contracts. Both routers can coexist, but two files must not claim the same route.
By the end, you can: preserve URLs while moving routes; avoid route collisions.
Prepare a disjoint mixed-router inventory
Before: pages/catalog/index.tsx -> /catalogAfter: app/catalog/page.tsx -> /catalog (remove old page in same change)Remain: pages/view.tsx -> /viewRemain: pages/api/stock.ts -> /api/stockRoot: app/layout.tsx -> App layout onlyExpected behavior: This migration slice has no duplicate public path. A file rename alone would not translate the data model.
How it works
Create app/layout.tsx with html and body and a minimal shared layout for App routes. Move relevant global styles, providers and document responsibilities from _app and _document into the new architecture as appropriate; Pages routes still need their own wrappers. Use metadata or generateMetadata instead of assuming next/head works in the new router. Convert a low-risk public page first. A Pages getStaticProps function does not move verbatim into App; use a Server Component and explicit rendering/cache choices for the selected lane. Convert Pages getStaticPaths to generateStaticParams plus intentional unknown-path policy, not a mechanical translation of fallback. App hooks come from next/navigation; query and pathname are separate hooks. API Routes can migrate independently to Route Handlers; use one route owner at a time and preserve response status, headers and methods explicitly. App method defaults can differ, particularly OPTIONS; test the contract rather than assuming identical behavior. Retain the previous deployable artifact and review data migration compatibility before rollout.
Replace one public static page with an App page
// app/catalog/page.tsx; root layout supplied separatelyexport default function Catalog(){ const titles=['Fern Atlas','River Walk']; return <main><h1>Catalog</h1><ul>{titles.map(title=><li key={title}>{title}</li>)}</ul></main>;}Expected behavior: The public content is equivalent to the original static list, but this fixture contains immutable data; a mutable production source would require a separately reviewed freshness policy.
Common mistake
Do not leave the old and new implementations at the same URL or copy getServerSideProps into app/page.tsx. Do not assume Page Router hooks, providers or ISR policies automatically transfer.
Practice and verification
Move /catalog in the provided staged migration fixture, retain /view and /api/stock, then compare the inventory. Document which components require client boundaries and which data must be revalidated.
Scope: Proposed Next.js 16.x, React 19, Node runtime. Root-mounted Pages and mixed-router fixtures with Cache Components disabled; the basePath example is separate. Framework examples are staged, not executed. Exact patched dependencies and platform contracts pending.