Next.js
Next.js

Migrating from Pages Router to App Router

February 13, 2026·7 min read

Migration is incremental: the router can coexist during migration. But understand architectural differences before starting: data fetching in Server Components vs getServerSideProps, layouts vs _app, Server Actions vs API routes.

Start with layout migration: create the same layout structure in app. Then pages: migrate pages one at a time, wrapping with 'use client' for interactivity. Finally use Server Actions—better than migrating to API routes.

Testing is critical: the behavior differs in edge cases between routers. Test client-side navigation, data mutations, and 404s. Run both routers in production to catch runtime issues.

Picklist may earn commission when you purchase through our affiliate links.