Skip to content

Commit 9527d63

Browse files
Add warning when transfering data using nginx (#1616)
* Add warning when transfering data using nginx * Rephrase caution callout --------- Co-authored-by: Pierre Wizla <[email protected]>
1 parent 93e7302 commit 9527d63

File tree

1 file changed

+37
-17
lines changed

1 file changed

+37
-17
lines changed

docusaurus/docs/dev-docs/data-management/transfer.md

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: Transfer data using the Strapi CLI
44
displayed_sidebar: devDocsSidebar
55
canonicalUrl: https://docs.strapi.io/dev-docs/data-management/transfer.html
66
---
7+
78
# Data transfer <BetaBadge />
89

910
The `strapi transfer` command streams your data from one Strapi instance to another Strapi instance. The `transfer` command uses strict schema matching, meaning your two Strapi instances need to be exact copies of each other except for the contained data. The default `transfer` command transfers your content (entities and relations), files (assets), project configuration, and schemas. The command allows you to transfer data:
@@ -38,6 +39,25 @@ Either `--to` or `--from` is required.
3839
Data transfers are authorized by transfer tokens, which are [managed from the admin panel](/user-docs/settings/managing-global-settings#managing-transfer-tokens). From the admin panel, you can manage role-based permissions to tokens including `view`, `create`, `read`, `regenerate` and `delete`.
3940
:::
4041

42+
:::warning
43+
When using nginx and a server that proxies requests into a localhost, issues might occur. To prevent them, ensure all the headers are forwarded correctly by changing the configuration file in `/etc/nginx/sites-available/yourdomain` as follows:
44+
45+
```
46+
server {
47+
listen 80;
48+
server_name <yourdomain>;
49+
location / {
50+
proxy_pass http://localhost:1337;
51+
proxy_set_header Upgrade $http_upgrade;
52+
proxy_set_header Connection "Upgrade";
53+
proxy_set_header Host $host;
54+
include proxy_params;
55+
}
56+
}
57+
```
58+
59+
:::
60+
4161
## Generate a transfer token
4262

4363
:::prerequisites
@@ -138,7 +158,7 @@ yarn strapi transfer --to https://example.com/admin --to-token my-transfer-token
138158
<TabItem value="npm" label="npm">
139159

140160
```bash
141-
npm run strapi transfer -- --to https://example.com/admin --to-token my-transfer-token --force
161+
npm run strapi transfer -- --to https://example.com/admin --to-token my-transfer-token --force
142162
```
143163

144164
</TabItem>
@@ -147,7 +167,7 @@ npm run strapi transfer -- --to https://example.com/admin --to-token my-transfer
147167

148168
## Include only specified data types during transfer
149169

150-
The default `strapi transfer` command transfers your content (entities and relations), files (assets), project configuration, and schemas. The `--only` option allows you to transfer only the listed items by passing a comma-separated string with no spaces between the types. The available values are `content`, `files`, and `config`. Schemas are always transferred, as schema matching is used for `strapi transfer`.
170+
The default `strapi transfer` command transfers your content (entities and relations), files (assets), project configuration, and schemas. The `--only` option allows you to transfer only the listed items by passing a comma-separated string with no spaces between the types. The available values are `content`, `files`, and `config`. Schemas are always transferred, as schema matching is used for `strapi transfer`.
151171

152172
### Example: only transfer files
153173

@@ -219,30 +239,30 @@ The `transfer` command is not intended for transferring data between two local i
219239
220240
1. Create a new Strapi project using the installation command:
221241
222-
```bash
223-
npx create-strapi-app@latest <project-name> --quickstart
224-
```
242+
```bash
243+
npx create-strapi-app@latest <project-name> --quickstart
244+
```
225245
226246
2. Create at least 1 content type in the project. See the [Quick Start Guide](/dev-docs/quick-start) if you need instructions on creating your first content type.
227247
228-
:::caution
229-
Do not add any data to your project at this step.
230-
:::
248+
:::caution
249+
Do not add any data to your project at this step.
250+
:::
231251
232252
3. Commit the project to a git repository:
233253
234-
```bash
235-
git init
236-
git add .
237-
git commit -m "first commit"
238-
```
254+
```bash
255+
git init
256+
git add .
257+
git commit -m "first commit"
258+
```
239259
240260
4. Clone the project repository:
241261
242-
```bash
243-
cd .. # move to the parent directory
244-
git clone <path to created git repository>.git/ <new-instance-name>
245-
```
262+
```bash
263+
cd .. # move to the parent directory
264+
git clone <path to created git repository>.git/ <new-instance-name>
265+
```
246266
247267
### Add data to the first Strapi instance
248268

0 commit comments

Comments
 (0)