Skip to content

Commit b110457

Browse files
authored
docs: add cloud update guide (medusajs#12778)
* docs: add cloud update guide * fixes
1 parent 1bf8d53 commit b110457

File tree

5 files changed

+115
-6
lines changed

5 files changed

+115
-6
lines changed

www/apps/cloud/app/support/page.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ There are two main ways to contact support: through the Cloud dashboard or throu
2121

2222
## Contact Support via Cloud
2323

24-
You'll find a <InlineIcon Icon={QuestionMarkCircle} alt="question" /> icon at the top right of the Cloud dashboard. Click on it to open the support form.
24+
You can find a <InlineIcon Icon={QuestionMarkCircle} alt="question" /> icon at the top right of the Cloud dashboard. Click on it to open the support form.
2525

2626
In the support form, you can provide a subject and a description of your issue. You can also attach files to help our team understand the problem better.
2727

@@ -45,10 +45,10 @@ If your plan includes Slack support, our team will set up a dedicated support ch
4545

4646
You can reach out on this channel to receive help from our team. You can:
4747

48-
- Ask questions about using Cloud
49-
- Report issues with the Cloud dashboard
50-
- Get assistance with operations that require actions from our team
51-
- Receive guidance on building custom features
48+
- Ask questions about using Cloud.
49+
- Report issues with the Cloud dashboard.
50+
- Get assistance with operations that require actions from our team.
51+
- Receive guidance on building custom features.
5252

5353
Make sure to provide as many details as possible about your issue to receive the best assistance. Also, please follow the guidelines shared in the channel to ensure a smooth support experience.
5454

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
export const metadata = {
2+
title: `Cloud Best Practices: Update Medusa Application`,
3+
}
4+
5+
# {metadata.title}
6+
7+
In this guide, you'll learn how to update your Medusa application that is deployed on Cloud.
8+
9+
<Note title="Looking for the general update guide?">
10+
11+
Refer to the [Update guide](!docs!/learn/update) to learn how to update your Medusa application.
12+
13+
</Note>
14+
15+
## Why Update Your Medusa Application?
16+
17+
Medusa regularly releases new versions of the core application with bug fixes, performance improvements, and new features.
18+
19+
It's highly recommended to always keep your Medusa application up to date. You'll benefit from the latest improvements and security patches.
20+
21+
---
22+
23+
## Update Your Deployed Medusa Application
24+
25+
This section provides best practices for updating your Medusa application on Cloud and how to update your application in a safe manner.
26+
27+
### Don't Push Directly to Production
28+
29+
It's **strongly discouraged** to push a new update directly to your production branch. While Medusa updates are generally safe and stable, it's always a good practice to test the update in a separate environment before deploying it to production.
30+
31+
By using a separate environment, you mitigate any unexpected issues that may arise during the update process. This way, you ensure that your customizations and configurations work correctly with the new version of Medusa.
32+
33+
The **recommended** approach is to [create a long-lived environment](../environments/page.mdx#create-a-long-lived-environment), such as Staging. You can push the new update and test it thoroughly in a production-like environment before deploying it to production.
34+
35+
<Note title="Tip">
36+
37+
Each environment has its own database, so you can safely update other environments and make data changes without affecting the production environment.
38+
39+
</Note>
40+
41+
![Diagram showcasing process of deploying to staging then production](https://res.cloudinary.com/dza7lstvk/image/upload/v1750334010/Cloud/deploy-to-staging_d4oyys.jpg)
42+
43+
Alternatively, you can open a pull request to the production branch, which will [create a preview environment](../environments/page.mdx#preview-environments). The preview environment allows you to test the update before merging it into the production branch.
44+
45+
![Diagram showcasing process of deploying to preview then production](https://res.cloudinary.com/dza7lstvk/image/upload/v1750334010/Cloud/deploy-to-preview_plpz9z.jpg)
46+
47+
### Ensure Custom Migrations Have Rollback Methods
48+
49+
When creating custom migrations, it's important to include both `up` and `down` methods. The `up` method should define the changes to be made to the database schema, while the `down` method should reverse those changes.
50+
51+
By including both methods, you can easily roll back database changes if you need to revert the application's update.
52+
53+
If you use the [db\:generate](!resources!/medusa-cli/commands/db#dbgenerate) command to generate migrations, it will automatically create both `up` and `down` methods for you. If you're creating the migrations manually, you can learn more in the [Migrations](!docs!/learn/fundamentals/data-models/write-migration) guide.
54+
55+
### Update Your Medusa Application
56+
57+
To update your Medusa application deployed on Cloud:
58+
59+
1. Update your Medusa application locally either on the long-lived environment's branch (for example, Staging) or in a new branch that will be used to create a pull request.
60+
- To learn how to update your Medusa application, refer to the [Update guide](!docs!/learn/update). It includes all the details you need to update the Medusa application locally.
61+
2. Once you're done updating your application locally, push the changes in `package.json`, lock file (for example, `yarn.lock`), and any other affected files to the branch.
62+
- If you're using a long-lived environment, Cloud will automatically deploy the changes to the branch's environment.
63+
- If you're using a new branch to create a pull request, open the pull request to the production branch. This will create a preview environment that you can use to test the update before merging it into the production branch.
64+
65+
Then, you can access the environment's [live deployment](../deployments/page.mdx#access-live-deployment) to test the update. You can also use the [build](../logs/page.mdx#view-build-logs) and [runtime](../logs/page.mdx#view-runtime-logs) logs of the environment to debug any issues that occur during the update process or testing.
66+
67+
### Push Update to Production
68+
69+
Once you've thoroughly tested the update in your long-lived or preview environment, you can merge the changes into your production branch.
70+
71+
Cloud will automatically deploy the changes to the production environment. This will update the production's code and database.
72+
73+
---
74+
75+
## Rollback Medusa Application Update
76+
77+
If you encounter any issues after updating your deployed Medusa application, you can [redeploy a previous deployment](../deployments/page.mdx#redeploy-a-deployment) to roll back the code changes made by the update.
78+
79+
However, redeploying a previous deployment will not roll back the database changes made by the update. If you need to roll back the database changes, [contact support](../support/page.mdx) for assistance.

www/apps/cloud/generated/edit-dates.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ export const generatedEditDates = {
1313
"app/loyalty-plugin/page.mdx": "2025-06-18T08:28:51.756Z",
1414
"app/billing-usage/page.mdx": "2025-06-18T10:35:56.993Z",
1515
"app/logs/page.mdx": "2025-06-19T07:44:38.336Z",
16-
"app/support/page.mdx": "2025-06-19T10:29:01.693Z"
16+
"app/support/page.mdx": "2025-06-19T11:18:37.253Z",
17+
"app/update-medusa/page.mdx": "2025-06-19T11:18:42.545Z"
1718
}

www/apps/cloud/generated/sidebar.mjs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,23 @@ export const generatedSidebars = [
162162
"children": []
163163
}
164164
]
165+
},
166+
{
167+
"loaded": true,
168+
"isPathHref": true,
169+
"type": "category",
170+
"title": "Best Practices",
171+
"initialOpen": true,
172+
"children": [
173+
{
174+
"loaded": true,
175+
"isPathHref": true,
176+
"type": "link",
177+
"title": "Update Medusa",
178+
"path": "/update-medusa",
179+
"children": []
180+
}
181+
]
165182
}
166183
]
167184
}

www/apps/cloud/sidebar.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ export const sidebar = [
112112
},
113113
],
114114
},
115+
{
116+
type: "category",
117+
title: "Best Practices",
118+
initialOpen: true,
119+
children: [
120+
{
121+
type: "link",
122+
title: "Update Medusa",
123+
path: "/update-medusa",
124+
},
125+
],
126+
},
115127
],
116128
},
117129
]

0 commit comments

Comments
 (0)