From e106dfb08ec2a6c5fc4ddb1be83b5e43194525dc Mon Sep 17 00:00:00 2001 From: Marc-Roig Date: Thu, 15 Sep 2022 15:49:26 +0200 Subject: [PATCH 01/13] move sizeLimit one level above in upload provider --- docs/developer-docs/latest/plugins/upload.md | 6 +- .../migration-guides.md | 3 +- .../v4/migration-guide-4.3.x-to-4.4.x.md | 109 ++++++++++++++++++ 3 files changed, 113 insertions(+), 5 deletions(-) create mode 100644 docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md diff --git a/docs/developer-docs/latest/plugins/upload.md b/docs/developer-docs/latest/plugins/upload.md index fa6b5cb2ad..71521203b8 100644 --- a/docs/developer-docs/latest/plugins/upload.md +++ b/docs/developer-docs/latest/plugins/upload.md @@ -135,7 +135,7 @@ export default { -In addition to the middleware configuration, you can pass the `sizeLimit`, which is an integer in bytes, in the `providerOptions` of the [plugin configuration](/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md) in `./config/plugins.js`: +In addition to the middleware configuration, you can pass the `sizeLimit`, which is an integer in bytes, in the [plugin configuration](/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md) in `./config/plugins.js`: @@ -148,9 +148,7 @@ module.exports = { // ... upload: { config: { - providerOptions: { - sizeLimit: 250 * 1024 * 1024 // 256mb in bytes - } + sizeLimit: 250 * 1024 * 1024 // 256mb in bytes } } }; diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides.md b/docs/developer-docs/latest/update-migration-guides/migration-guides.md index 9d4dbe5a01..51a07786d2 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides.md @@ -18,7 +18,8 @@ Migrations are necessary when upgrades to Strapi include breaking changes. The m - [Migration guide from 4.0.0+ to 4.0.6](migration-guides/v4/migration-guide-4.0.0-to-4.0.6.md) - [Migration guide from 4.0.6+ to 4.1.8](migration-guides/v4/migration-guide-4.0.6-to-4.1.8.md) - [Migration guide from 4.1.8+ to 4.1.10](migration-guides/v4/migration-guide-4.1.8-to-4.1.10.md) -- [Migration guide from 4.2.x to 4.3.x](migration-guides/v4/migration-guide-4.2.x-to-4.3.x.md) +- [Migration guide from 4.2.x to 4.3.X](migration-guides/v4/migration-guide-4.2.x-to-4.3.x.md) +- [Migration guide from 4.3.x to 4.4.x](migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md) ## v3 to v4 migration guides diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md new file mode 100644 index 0000000000..79a9b11330 --- /dev/null +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md @@ -0,0 +1,109 @@ +--- +title: Migrate from 4.2.x to 4.3.x - Strapi Developer Docs +description: Learn how you can migrate your Strapi application from 4.3.x to 4.4.x. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x+-to-4.4.x.html +--- + +# v4.3.x to v4.4.x migration guide + +The Strapi v4.3.x to v4.4.x migration guide upgrades versions of v4.3.x and above to v4.4.x. This migration guide is needed for all users who were limiting media size for the local upload provider. The migration to 4.4.x consists of 3 steps: + +- Upgrading the application dependencies +- Updating the local upload provider sizeLimit +- Reinitializing the application + +## Upgrading the application dependencies to 4.4.x (x is the latest minor version of v4.4) + +:::prerequisites +Stop the server before starting the upgrade. At the time of writing this, the latest version of Strapi is v4.4.0. +::: + +1. Upgrade all of the Strapi packages in the `package.json` to `4.4.0`: + +```jsx +// path: package.json + +{ + // ... + "dependencies": { + "@strapi/strapi": "4.4.0", + "@strapi/plugin-users-permissions": "4.4.0", + "@strapi/plugin-i18n": "4.4.0", + // ... + } +} + +``` + +2. Save the edited `package.json` file. + +3. Run either `yarn` or `npm install` to install the new version. + +::: tip +If the operation doesn't work, try removing your `yarn.lock` or `package-lock.json`. If that doesn't help, remove the `node_modules` folder as well and try again. +::: + +## Updating the sizeLimit provider configuration + +This step is only required if you were using the https://docs.strapi.io/developer-docs/latest/plugins/upload.html#max-file-size for your upload provider. + +:::caution +The sizeLimit was specified to be in bytes, but it was actually in kilobytes. We have now fixed it to follow the docs, and the limit will be read as bytes. + +If you, for some reason, were limiting the file size as kilobytes, you should update the value to be in bytes. +::: + +We recommend to move the sizeLimit outside the provider options like the following, as we will deprecate + + + + + +```js +// path: ./config/plugins.js + +module.exports = { + // ... + upload: { + config: { + sizeLimit: 250 * 1024 * 1024 // Now + providerOptions: { + sizeLimit: 250 * 1024 * 1024 // Before + } + } + } +}; +``` + + + + + +```js +// path: ./config/plugins.ts + +export default { + // ... + upload: { + config: { + sizeLimit: 250 * 1024 * 1024 // Now + providerOptions: { + sizeLimit: 250 * 1024 * 1024 // Before + } + } + } +}; +``` + + + + + + +To change the script: + +1. In the `./config/plugins.js` file, Identify the upload configuration if you have one. +2. Move your sizeLimit, if you have one, one level above providerOptions. + + +!!!include(developer-docs/latest/update-migration-guides/migration-guides/v4/snippets/Rebuild-and-start-snippet.md)!!! From d3ae2b74bd18c4dbc01bce8c794f14efb98ae728 Mon Sep 17 00:00:00 2001 From: Marc-Roig Date: Thu, 15 Sep 2022 15:59:00 +0200 Subject: [PATCH 02/13] add sizeLimit deprecation warning --- .../migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md index 79a9b11330..997eb38011 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md @@ -53,7 +53,7 @@ The sizeLimit was specified to be in bytes, but it was actually in kilobytes. We If you, for some reason, were limiting the file size as kilobytes, you should update the value to be in bytes. ::: -We recommend to move the sizeLimit outside the provider options like the following, as we will deprecate +We recommend to move the sizeLimit outside the provider options like the following, as it will be deprecated in the next major version. From f0a77b451242cd0a5942bf8e3245558a60f8f13b Mon Sep 17 00:00:00 2001 From: Marc-Roig Date: Thu, 15 Sep 2022 16:01:36 +0200 Subject: [PATCH 03/13] minor change --- .../latest/update-migration-guides/migration-guides.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides.md b/docs/developer-docs/latest/update-migration-guides/migration-guides.md index 51a07786d2..9b25d0e174 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides.md @@ -18,7 +18,7 @@ Migrations are necessary when upgrades to Strapi include breaking changes. The m - [Migration guide from 4.0.0+ to 4.0.6](migration-guides/v4/migration-guide-4.0.0-to-4.0.6.md) - [Migration guide from 4.0.6+ to 4.1.8](migration-guides/v4/migration-guide-4.0.6-to-4.1.8.md) - [Migration guide from 4.1.8+ to 4.1.10](migration-guides/v4/migration-guide-4.1.8-to-4.1.10.md) -- [Migration guide from 4.2.x to 4.3.X](migration-guides/v4/migration-guide-4.2.x-to-4.3.x.md) +- [Migration guide from 4.2.x to 4.3.x](migration-guides/v4/migration-guide-4.2.x-to-4.3.x.md) - [Migration guide from 4.3.x to 4.4.x](migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md) ## v3 to v4 migration guides From 7bb333befd820a0e3f79d53105f7f1fd1fc3f765 Mon Sep 17 00:00:00 2001 From: Marc-Roig Date: Thu, 15 Sep 2022 17:43:21 +0200 Subject: [PATCH 04/13] minor change --- .../migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md index 997eb38011..99ea9ab9e6 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md @@ -45,16 +45,15 @@ If the operation doesn't work, try removing your `yarn.lock` or `package-lock.js ## Updating the sizeLimit provider configuration -This step is only required if you were using the https://docs.strapi.io/developer-docs/latest/plugins/upload.html#max-file-size for your upload provider. +This step is only required if you were using the [sizeLimit configuration](https://docs.strapi.io/developer-docs/latest/plugins/upload.html#max-file-size) for your upload provider. :::caution -The sizeLimit was specified to be in bytes, but it was actually in kilobytes. We have now fixed it to follow the docs, and the limit will be read as bytes. +The docs required the sizeLimit to be in bytes, but it was actually in kilobytes. This is now fixed, and the limit will be interpreted as bytes. -If you, for some reason, were limiting the file size as kilobytes, you should update the value to be in bytes. +If you, for some reason, were limiting the file size to kilobytes, you should update the value to be in bytes. ::: We recommend to move the sizeLimit outside the provider options like the following, as it will be deprecated in the next major version. - From 34561f30a166d4dfad4d0461c0b7e646f1b241c9 Mon Sep 17 00:00:00 2001 From: Marc-Roig Date: Fri, 16 Sep 2022 11:14:22 +0200 Subject: [PATCH 05/13] checkFileSize upload provider --- docs/developer-docs/latest/development/providers.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/developer-docs/latest/development/providers.md b/docs/developer-docs/latest/development/providers.md index 4cb30d513f..04a19a3010 100644 --- a/docs/developer-docs/latest/development/providers.md +++ b/docs/developer-docs/latest/development/providers.md @@ -151,6 +151,11 @@ module.exports = { delete(file) { // delete the file in the provider }, + checkFileSize(file, { sizeLimit }) { + // implement your own file size limit logic + // there is a default logic in place if this + // method is not implemented + }, }; }, }; From 4c2ebb67f4b38065f8860fca0a36a957a54bd082 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 16 Sep 2022 15:40:44 +0200 Subject: [PATCH 06/13] Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla --- .../migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md index 99ea9ab9e6..80ff3c259d 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md @@ -1,5 +1,5 @@ --- -title: Migrate from 4.2.x to 4.3.x - Strapi Developer Docs +title: Migrate from 4.3.x to 4.4.x - Strapi Developer Docs description: Learn how you can migrate your Strapi application from 4.3.x to 4.4.x. canonicalUrl: https://docs.strapi.io/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x+-to-4.4.x.html --- From 660f05f6c19c5fa7e243758d3185559506de2714 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 16 Sep 2022 15:40:57 +0200 Subject: [PATCH 07/13] Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla --- .../migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md index 80ff3c259d..c8ca88ed68 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md @@ -48,7 +48,7 @@ If the operation doesn't work, try removing your `yarn.lock` or `package-lock.js This step is only required if you were using the [sizeLimit configuration](https://docs.strapi.io/developer-docs/latest/plugins/upload.html#max-file-size) for your upload provider. :::caution -The docs required the sizeLimit to be in bytes, but it was actually in kilobytes. This is now fixed, and the limit will be interpreted as bytes. +The documentation required the `sizeLimit` to be in bytes, but it was actually in kilobytes. This is now fixed, and the limit will be interpreted as bytes. If you, for some reason, were limiting the file size to kilobytes, you should update the value to be in bytes. ::: From 18ebdf5de9cd79cf979f619b1fa523ec0ee6f49d Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 16 Sep 2022 15:41:18 +0200 Subject: [PATCH 08/13] Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla --- .../migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md index c8ca88ed68..477788984a 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md @@ -9,7 +9,7 @@ canonicalUrl: https://docs.strapi.io/developer-docs/latest/update-migration-guid The Strapi v4.3.x to v4.4.x migration guide upgrades versions of v4.3.x and above to v4.4.x. This migration guide is needed for all users who were limiting media size for the local upload provider. The migration to 4.4.x consists of 3 steps: - Upgrading the application dependencies -- Updating the local upload provider sizeLimit +- Updating the local upload provider `sizeLimit` - Reinitializing the application ## Upgrading the application dependencies to 4.4.x (x is the latest minor version of v4.4) From 0ed68ebd5e63b30d43bb7e98d409ab488a7e8c02 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 16 Sep 2022 15:41:55 +0200 Subject: [PATCH 09/13] Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla --- .../migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md index 477788984a..c2fcf0f469 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md @@ -45,7 +45,7 @@ If the operation doesn't work, try removing your `yarn.lock` or `package-lock.js ## Updating the sizeLimit provider configuration -This step is only required if you were using the [sizeLimit configuration](https://docs.strapi.io/developer-docs/latest/plugins/upload.html#max-file-size) for your upload provider. +This step is only required if you were using the [`sizeLimit` configuration](/developer-docs/latest/plugins/upload.md#max-file-size) for your upload provider. :::caution The documentation required the `sizeLimit` to be in bytes, but it was actually in kilobytes. This is now fixed, and the limit will be interpreted as bytes. From c4166068e064c5f109d0406876be6cb41e1be682 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 16 Sep 2022 15:42:01 +0200 Subject: [PATCH 10/13] Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla --- .../migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md index c2fcf0f469..8317669d9c 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md @@ -53,7 +53,7 @@ The documentation required the `sizeLimit` to be in bytes, but it was actually i If you, for some reason, were limiting the file size to kilobytes, you should update the value to be in bytes. ::: -We recommend to move the sizeLimit outside the provider options like the following, as it will be deprecated in the next major version. +We recommend to move the `sizeLimit` outside the provider options like the following, as it will be deprecated in the next major version. From ab015ef9d5ffacb78cb7f70674982778bc6676e4 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 16 Sep 2022 15:42:16 +0200 Subject: [PATCH 11/13] Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla --- .../migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md index 8317669d9c..6a9be72569 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md @@ -102,7 +102,7 @@ export default { To change the script: 1. In the `./config/plugins.js` file, Identify the upload configuration if you have one. -2. Move your sizeLimit, if you have one, one level above providerOptions. +2. (_optional_) If you have a `sizeLimit`, move it one level above `providerOptions`. !!!include(developer-docs/latest/update-migration-guides/migration-guides/v4/snippets/Rebuild-and-start-snippet.md)!!! From 5049a3f0b9991aa922c8ed39aad4d70070bb3756 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 16 Sep 2022 15:42:20 +0200 Subject: [PATCH 12/13] Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla --- .../migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md index 6a9be72569..8b6aab8228 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md @@ -101,7 +101,7 @@ export default { To change the script: -1. In the `./config/plugins.js` file, Identify the upload configuration if you have one. +1. In the `./config/plugins.js` file, identify the upload configuration if you have one. 2. (_optional_) If you have a `sizeLimit`, move it one level above `providerOptions`. From a5c44ceff108625cb0a89acfc28515523c20f3ad Mon Sep 17 00:00:00 2001 From: Marc-Roig Date: Wed, 1 Feb 2023 16:15:27 +0100 Subject: [PATCH 13/13] move migration steps to 4.5.1 to 4.6.1 --- .../v4/migration-guide-4.3.x-to-4.4.x.md | 108 ------------------ .../v4/migration-guide-4.5.1-to-4.6.1.md | 65 ++++++++++- 2 files changed, 64 insertions(+), 109 deletions(-) delete mode 100644 docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md deleted file mode 100644 index 8b6aab8228..0000000000 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Migrate from 4.3.x to 4.4.x - Strapi Developer Docs -description: Learn how you can migrate your Strapi application from 4.3.x to 4.4.x. -canonicalUrl: https://docs.strapi.io/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x+-to-4.4.x.html ---- - -# v4.3.x to v4.4.x migration guide - -The Strapi v4.3.x to v4.4.x migration guide upgrades versions of v4.3.x and above to v4.4.x. This migration guide is needed for all users who were limiting media size for the local upload provider. The migration to 4.4.x consists of 3 steps: - -- Upgrading the application dependencies -- Updating the local upload provider `sizeLimit` -- Reinitializing the application - -## Upgrading the application dependencies to 4.4.x (x is the latest minor version of v4.4) - -:::prerequisites -Stop the server before starting the upgrade. At the time of writing this, the latest version of Strapi is v4.4.0. -::: - -1. Upgrade all of the Strapi packages in the `package.json` to `4.4.0`: - -```jsx -// path: package.json - -{ - // ... - "dependencies": { - "@strapi/strapi": "4.4.0", - "@strapi/plugin-users-permissions": "4.4.0", - "@strapi/plugin-i18n": "4.4.0", - // ... - } -} - -``` - -2. Save the edited `package.json` file. - -3. Run either `yarn` or `npm install` to install the new version. - -::: tip -If the operation doesn't work, try removing your `yarn.lock` or `package-lock.json`. If that doesn't help, remove the `node_modules` folder as well and try again. -::: - -## Updating the sizeLimit provider configuration - -This step is only required if you were using the [`sizeLimit` configuration](/developer-docs/latest/plugins/upload.md#max-file-size) for your upload provider. - -:::caution -The documentation required the `sizeLimit` to be in bytes, but it was actually in kilobytes. This is now fixed, and the limit will be interpreted as bytes. - -If you, for some reason, were limiting the file size to kilobytes, you should update the value to be in bytes. -::: - -We recommend to move the `sizeLimit` outside the provider options like the following, as it will be deprecated in the next major version. - - - - -```js -// path: ./config/plugins.js - -module.exports = { - // ... - upload: { - config: { - sizeLimit: 250 * 1024 * 1024 // Now - providerOptions: { - sizeLimit: 250 * 1024 * 1024 // Before - } - } - } -}; -``` - - - - - -```js -// path: ./config/plugins.ts - -export default { - // ... - upload: { - config: { - sizeLimit: 250 * 1024 * 1024 // Now - providerOptions: { - sizeLimit: 250 * 1024 * 1024 // Before - } - } - } -}; -``` - - - - - - -To change the script: - -1. In the `./config/plugins.js` file, identify the upload configuration if you have one. -2. (_optional_) If you have a `sizeLimit`, move it one level above `providerOptions`. - - -!!!include(developer-docs/latest/update-migration-guides/migration-guides/v4/snippets/Rebuild-and-start-snippet.md)!!! diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md index 5d2be00770..b869df6a99 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md @@ -6,10 +6,13 @@ canonicalUrl: https://docs.strapi.io/developer-docs/latest/update-migration-guid # v4.5.1+ to v4.6.1 migration guide -The Strapi v4.5.1+ to v4.6.1 migration guide upgrades v4.5.1+ to v4.6.1. We introduced a configuration for webhooks to receive populated relations. The migration guide consists of: +The Strapi v4.5.1+ to v4.6.1 migration guide upgrades v4.5.1+ to v4.6.1. We introduced a configuration for webhooks to receive populated relations. Also, this migration guide is needed for all users who were limiting media size for the local upload provider. + +The migration guide consists of: - Upgrading the application dependencies - Changing the webhooks configuration (optional) +- Updating the local upload provider `sizeLimit` - Reinitializing the application ## Upgrading the application dependencies to 4.6.1 @@ -66,4 +69,64 @@ With this, you will no longer receive populated relations in webhooks, and **res You can see more of the available configuration options in the [server configuration documentation](/developer-docs/latest/setup-deployment-guides/configurations/required/server.md). +## Updating the sizeLimit provider configuration + +This step is only required if you were using the [`sizeLimit` configuration](/developer-docs/latest/plugins/upload.md#max-file-size) for your upload provider. + +:::caution +The documentation required the `sizeLimit` to be in bytes, but it was actually in kilobytes. This is now fixed, and the limit will be interpreted as bytes. + +If you, for some reason, were limiting the file size to kilobytes, you should update the value to be in bytes. +::: + +We recommend to move the `sizeLimit` outside the provider options like the following, as it will be deprecated in the next major version. + + + + +```js +// path: ./config/plugins.js + +module.exports = { + // ... + upload: { + config: { + sizeLimit: 250 * 1024 * 1024 // Now + providerOptions: { + sizeLimit: 250 * 1024 * 1024 // Before + } + } + } +}; +``` + + + + + +```js +// path: ./config/plugins.ts + +export default { + // ... + upload: { + config: { + sizeLimit: 250 * 1024 * 1024 // Now + providerOptions: { + sizeLimit: 250 * 1024 * 1024 // Before + } + } + } +}; +``` + + + + + +To change the script: + +1. In the `./config/plugins.js` file, identify the upload configuration if you have one. +2. (_optional_) If you have a `sizeLimit`, move it one level above `providerOptions`. + !!!include(developer-docs/latest/update-migration-guides/migration-guides/v4/snippets/Rebuild-and-start-snippet.md)!!!