Tesseract SA

Moving to Server-Side Rendering Without Breaking Your App

A single-page app can move to server-side rendering without a rewrite. URL inventory, rendering mode per route, batch migration, common technical traps and a checklist before the switch.

Matte 3D illustration on a light grey background: a row of white cubes leading to a platform, with one red cube crossing onto it.

Migrating to server-side rendering without a rewrite

Moving an existing app to server-side rendering (SSR) does not require rewriting it. The approach that limits damage is to lift the app as it is into a framework that can render HTML on the server, then convert public routes one at a time, starting with the ones that matter for search. Logged-in pages, dashboards and heavily interactive screens can stay rendered in the browser for as long as needed.

This framing answers a real worry. A React, Vue or Angular app that works well for its users sends the server a near-empty document that the browser fills in afterwards. Googlebot can wait for that. AI assistant crawlers read the raw HTML, as we explain in our article on the JavaScript trap. Once the diagnosis is made, the question becomes practical: how do you fix it without breaking what works or losing the traffic you already have?

What a migration changes, and what it does not

Switching framework fixes nothing on its own. An SEO consultant who documents this kind of project puts it plainly: a migration improves indexing only when the new site gives crawlers better, more stable HTML than the old one. It does not preserve URLs, rebuild missing content or fix a wrong canonical tag.

The official Next.js documentation agrees on the technical side: an existing single-page app can migrate without large code changes, then gain server features progressively. The project starts as a purely client-side app, and the server is added where it earns its place. That sequencing is what allows small, reversible releases.

Step 1: inventory your URLs before touching code

Before the first line of code, list the addresses that exist and the ones that bring value. One source is not enough: combine the sitemap, Search Console, analytics, server logs and the links used in your emails and campaigns. Each URL gets a decision: kept as is, redirected, or deliberately retired.

Redirects are the sensitive part. Sending a detailed page to the homepage or to a generic index breaks the intent of the person looking for that page, and search engines often treat it as an error. Each important old address should point to its closest equivalent.

Step 2: sort routes by the rendering mode that suits them

Not every page needs a server on every visit. The table below shows a common split, which we adapt to each project.

Page typeSuggested rendering modeExample
Public and stableStatic generation at build timeService page, blog post, About page
Public and updated regularlyStatic with periodic regenerationCatalogue, reference list, public rates
Public and request-dependentServer rendering on each requestFiltered results, location-based page
Private or account-specificBrowser or server rendering behind authenticationCustomer area, dashboard
Internal search and filtersExplicit crawl strategyFilter combinations you do not want indexed in bulk

This grid avoids the most expensive mistake: applying server rendering to the whole site on principle. A static page answers faster and costs less to host than one recomputed on every visit. Dynamic server rendering is for pages that truly depend on the request.

Step 3: start in client mode inside the new framework

The first release deliberately changes almost nothing for your users. You install the framework, load the existing app with its current router, and check that everything works as before. The official migration guides from Create React App or Vite recommend this approach: it lowers the risk of incidents and limits merge conflicts with the team that keeps shipping features in the meantime.

This step brings no SEO gain, and that is expected. Its job is to replace the foundation without disturbing production. If something breaks, the area to inspect is small.

Step 4: migrate route by route, most valuable first

Pages are then converted one by one. The order follows a simple criterion: the page’s value for search, divided by the effort to convert it. A service page that brings in enquiries and has little interactivity goes first. A complex screen full of local state can wait.

Each converted route should ship with its own check: same URL, same title, same visible text, and the content present in the raw HTML. Treat a route as migrated only when those four points pass, not when the code compiles.

A variant puts the new framework in front of the old app and hands it the migrated routes, while the rest keep being served by the old code. It suits teams that cannot accept any interruption, but it adds an infrastructure layer to monitor. For a site of a few dozen pages, direct conversion is usually simpler.

The technical traps that keep coming back

Published field reports on these migrations describe very similar difficulties from one project to the next.

  • Libraries that read window on load. They crash on the server, where no browser exists. Isolate them in a component that loads in the browser only.
  • Environment variables. The prefix differs between tools. A wrongly named variable simply returns an empty value, with no error message.
  • Hydration mismatches. If the HTML produced by the server differs from what the browser rebuilds, React raises an error and can degrade a render that was correct.
  • Loading states. In a single-page app, a table header only appears once data arrives. On the server, the structure must exist before the data, which forces you to rethink these screens.
  • Content hidden behind a browser-only component. Whatever the page shows while waiting becomes the HTML that crawlers read. Text meant to be indexed must never sit in that zone.

Step 5: compare old and new HTML before switching over

The check that matters happens on the raw HTML, not on what you see on screen. For each family of pages, fetch the document returned by the old site and the new one, without running JavaScript, and compare: title, description, canonical tag, headings, main text, internal links, structured data. A difference is not necessarily an error, but each one must be explainable.

Here is the checklist we run before every release:

  1. Important pages return 200.
  2. Retired addresses return the intended redirect, or a deliberate 404.
  3. Redirects are permanent when the change is permanent.
  4. Canonical tags use the final production domain.
  5. No blocking rule from the staging site remains in the robots file.
  6. The sitemap contains only canonical, indexable addresses.
  7. Key content appears in the raw HTML.
  8. Internal links are real links, crawlable without JavaScript.
  9. Speed metrics have not noticeably regressed.
  10. Search Console and analytics are ready before the switch.

A ten-page test to see where you stand

Take ten important public pages. For each, open the page source (the one shown by “view source”, not the inspector) and search for a sentence from your main text. If the sentence is there, the page is readable by AI crawlers. If it is missing, the page needs migrating. The resulting ratio, for example seven readable pages out of ten, gives the real scope of the project before any budget discussion. For smaller sites, the test takes fifteen minutes.

After the switch: what to watch for six weeks

Going live does not close the project. In the following weeks, watch three signals: crawl errors reported in Search Console, the number of indexed pages per page family, and pages losing impressions compared with the previous period. A drop confined to one family of pages almost always points to a precise gap, such as a changed title, a misplaced canonical or a missing redirect, and can be fixed within hours.

Keep the old version deployable during this period. A quick rollback beats an improvised patch on a site that is losing traffic. The same logic applies to your team: agree in advance who decides to roll back, and on which signal, so that nobody debates it on the day.

When this migration is not the right choice

Server rendering is not mandatory for every app. Three situations rule it out.

  • The whole app sits behind a login. No public page needs to be read by a crawler. The migration would only add complexity.
  • Only a few pages matter for search. It is often cheaper to move those pages (home, services, blog) into a separate static site and leave the app untouched on a subdomain.
  • The app is about to be replaced. Migrating code you will retire in six months makes no sense: build server rendering into the rebuild instead, as we describe in the article on SEO in the architecture.

Prerendering through an external service remains an acceptable stopgap, but it adds a dependency and a point of failure. It helps in the short term, it does not replace a sound architecture.

How we approach this work

We start with the inventory and the ten-page test, then propose a migration order with the scope of each batch. Each batch ships to production on its own, with a way back. The work falls under one of the studio’s missions and is scoped at a fixed price once the perimeter is known.

Frequently asked questions

Can you move to server-side rendering without rewriting everything?

Yes. The Next.js documentation states that an existing single-page app can migrate without large code changes, then gain server features progressively. You start in client mode, then convert public routes one at a time.

Which pages should be migrated first?

The ones with the most value for search and the least interactivity: service pages, product pages, articles. Logged-in areas and screens heavy on local state can wait, or stay rendered in the browser.

Does migrating to Next.js automatically improve SEO?

No. It only improves indexing if the new site gives crawlers more complete and more stable HTML than the old one. URLs, redirects, canonical tags and content must be checked separately.

How do I check that AI crawlers see my content after the migration?

View the raw page source, without running JavaScript, and search for a sentence from your main text. If it is there, a crawler reading raw HTML sees it too. Repeat the test on about ten pages.

Sources
Read next