# Upgrading to Strapi 5 - Introduction and FAQ

> Source: https://docs.strapi.io/cms/migration/v4-to-v5/introduction-and-faq

Upgrading to Strapi 5 from v4 uses an upgrade tool with codemods to handle code changes, while built-in data migration scripts automatically update the database on first startup.

The latest major version of Strapi is Strapi 5. Strapi v4 is still supported until April 2026.

Whenever you feel ready to upgrade to Strapi 5, the present page will help you. It lists all available resources for upgrading from Strapi 4 to Strapi 5 and answers general questions you might have.

## Available resources

All of the following available resources will help you upgrade your application and plugins to Strapi 5, from the most common to the most specific use cases:

- [Step-by-step guide](/cms/migration/v4-to-v5/step-by-step): Read this guide first to get an overview of the upgrade process.
- [Upgrade tool reference](/cms/upgrade-tool): Learn more about how the upgrade tool can automatically migrate some parts of your Strapi v4 application to Strapi 5.
- [Breaking changes list](/cms/migration/v4-to-v5/breaking-changes): Read more about the differences between Strapi v4 and v5, the resulting breaking changes, and how to handle them manually or with the help of the codemods provided with the upgrade tool.
- [Specific resources](/cms/migration/v4-to-v5/additional-resources/introduction): Handle specific use cases such as the deprecation of the Entity Service API in favor of the new Document Service API, the plugins migration, and the deprecation of the helper-plugin.

## Frequently asked questions

The following questions and their answers should help you cover the most common use cases:

<details style={{backgroundColor: 'transparent', border: 'solid 1px #4945ff' }}>
<summary style={{fontSize: '18px'}}>How can I handle the upgrade and the installation of the latest dependencies?<br/>How can I handle the breaking changes in the code and adapt my code to Strapi 5?</summary>

Strapi provides an [upgrade tool](/cms/upgrade-tool) to ease the process. The upgrade tool is a command line tool with some commands that handle the upgrade of the dependencies and the execution of **codemods** .

Follow the <a href="/cms/migration/v4-to-v5/step-by-step">step-by-step guide</a> to learn how to use this tool in the context of upgrading to Strapi 5.

Strapi 5 docs also provide a [complete breaking changes database](/cms/migration/v4-to-v5/breaking-changes) and [dedicated resources](/cms/migration/v4-to-v5/additional-resources/introduction) to cover specific use cases.
<br/>

</details>

<details style={{backgroundColor: 'transparent', border: 'solid 1px #4945ff' }}>
<summary style={{fontSize: '18px'}}>How can I handle the data migration, ensuring that in Strapi 5 the application will still be working?</summary>
<p>Strapi 5 integrates a series of data migration scripts that are run once the application starts for the first time in Strapi 5.</p>
<p>However, please <strong>always backup your database</strong> (found at <code style={{color: 'rgb(73, 69, 255)', backgroundColor: 'rgb(240, 240, 255)'}}>.tmp/data.db</code> by default if using a SQL database) before performing any upgrade, as instructed in the <a href="/cms/migration/v4-to-v5/step-by-step">step-by-step guide</a>.</p>
<br/>
</details>

<details style={{backgroundColor: 'transparent', border: 'solid 1px #4945ff' }}>
<summary style={{fontSize: '18px'}}>As a Strapi Cloud customer, how can I handle the entire upgrade and deployment of my Strapi 5 application?</summary>

1. [Create a backup](/cloud/projects/settings#backups) and update your code locally, following the <a href="/cms/migration/v4-to-v5/step-by-step">step-by-step guide</a>.
2. Run the `yarn deploy` or `npm run deploy` commands from the [Cloud CLI](/cloud/cli/cloud-cli).<br/>

Strapi Cloud will deploy the updated code in Strapi 5 and will automatically run the data migration script.
<br/>

</details>

<details style={{backgroundColor: 'transparent', border: 'solid 1px #4945ff' }}>
<summary style={{fontSize: '18px'}}>How do I keep the legacy <code>attributes</code> wrapper during the migration?</summary>

- For REST clients, add the `Strapi-Response-Format: v4` header while you refactor your code. The [new response format breaking change](/cms/migration/v4-to-v5/breaking-changes/new-response-format#migration) shows where to add the header in `curl`, `fetch`, and Axios requests.
- For GraphQL clients, enable `v4CompatibilityMode` and follow the steps of the [GraphQL API migration documentation](/cms/migration/v4-to-v5/breaking-changes/graphql-api-updated#migration) to gradually remove `attributes`.
- REST responses continue to expose both `id` (legacy) and [`documentId`](/cms/migration/v4-to-v5/breaking-changes/use-document-id) when the header is enabled. GraphQL never exposes numeric `id`, so update your queries to use `documentId` even before you turn compatibility mode off.

Once every consumer reads the flattened format, remove the header so Strapi emits the Strapi 5 response shape by default.
<br/>

</details>

<details style={{backgroundColor: 'transparent', border: 'solid 1px #4945ff' }}>
<summary style={{fontSize: '18px'}}>Why does the admin build fail with <code>Cannot find module &apos;react&apos;</code> while my project is still on Strapi v4?</summary>

<p>Patch upgrades across Strapi v4 minors can fail the admin build with <code>Cannot find module &apos;react&apos;</code> (or similar). Newer v4 lines expect <code>react</code>, <code>react-dom</code>, <code>react-router-dom</code>, and <code>styled-components</code> to be listed explicitly in your app <code>package.json</code> instead of relying only on transitive resolution.</p>

<p>Copy the versions from a fresh Strapi v4 project that matches your target release (for example run the official generator in a throwaway folder), then install and rebuild. A typical set looks like this:</p>

```json
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router-dom": "5.3.4",
"styled-components": "5.3.3"
```

<p>Using a tilde or caret range on <code>@strapi/strapi</code> (for example <code>~4.25.22</code>) is fine for patch updates; when you skip several minors, read the release notes and migration notes for each jump.</p>

<p>The archived v4 Developer Documentation still lives on [docs-v4.strapi.io](https://docs-v4.strapi.io/dev-docs/migration-guides).</p>
<br/>

</details>

<details style={{backgroundColor: 'transparent', border: 'solid 1px #4945ff' }}>
<summary style={{fontSize: '18px'}}>Can I downgrade from Strapi 5 back to Strapi 4?</summary>

<p>Strapi does not ship an automated downgrade from Strapi 5 to Strapi 4.</p>

<p>Data migration scripts that run when Strapi 5 starts are not reversed by the product.</p>

<p>If you must return to Strapi 4, restore the database backup you created before the upgrade. Check out the Git branch or tag that still matches Strapi 4.</p>

<p>Reinstall dependencies so <code>package.json</code> and the lockfile match that snapshot.</p>

<p>Plan backups and staging environments using the <a href="/cms/migration/v4-to-v5/step-by-step">step-by-step guide</a> before you upgrade production.</p>
<br/>

</details>
