You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add transfer "pull" (from) to Data Management System documentation (#1604)
* Mark data transfer as new in the TOC
* Fix formatting and consistency
* Update intro sentences to account for transfer pull
* Shorten tip about admin panel
* Add `--from` parameter
* Mention token type in user guide
* Update screenshot in user guide to account for token type
* Adapt content (minimal set of commands) to both --to and --from use cases
* Fix: remote <> remote not allowed
Co-authored-by: Ben Irvin <[email protected]>
* Fix syntax: remote URL → remoteURL
Co-authored-by: Ben Irvin <[email protected]>
* Fix: can't edit duration
* Fix wording: or → and/or
Co-authored-by: Jean-Sébastien Herbaux <[email protected]>
* Fix syntax: destination URL → destinationURL
Co-authored-by: Ben Irvin <[email protected]>
* Fix syntax: remote URL → remoteURL
Co-authored-by: Ben Irvin <[email protected]>
* Explicitly state one should use either --to or --from
* Simplify wording in caution callout
Co-authored-by: Ben Irvin <[email protected]>
* Update docusaurus/docs/dev-docs/data-management/transfer.md
* Update docusaurus/docs/dev-docs/data-management/transfer.md
Co-authored-by: Ben Irvin <[email protected]>
* Align prompt wording with commit 21ef0245790ab3350db9b2e2e677d3b626099253
* Align prompt wording with commit 21ef0245790ab3350db9b2e2e677d3b626099253
---------
Co-authored-by: Ben Irvin <[email protected]>
Co-authored-by: Jean-Sébastien Herbaux <[email protected]>
|`--to [destinationURL]`| Full URL of the `/admin` endpoint on the destination Strapi instance<br />(e.g. `--to https://my-beautiful-strapi-website/admin`) |
174
+
|`--to-token [transferToken]`| Transfer token for the remote Strapi destination |
175
+
|`--from [sourceURL]`| Full URL of the `/admin` endpoint of the remote Strapi instance to pull data from<br />(e.g., `--from https://my-beautiful-strapi-website/admin`) |
176
+
|`‑‑from‑token`| Transfer token from the Strapi source instance. |
177
+
|`--force`| Automatically answer "yes" to all prompts, including potentially destructive requests, and run non-interactively. |
178
+
|`--exclude`| Exclude data using comma-separated data types. The available types are: `content`, `files`, and `config`. |
179
+
|`--only`| Include only these data. The available types are: `content`, `files`, and `config`. |
180
+
|`-h`, `--help`| Displays the commands for `strapi transfer`. |
181
+
182
+
:::caution
183
+
Either `--to` or `--from` is required, but it's not currently allowed to enter both or neither.
Copy file name to clipboardExpand all lines: docusaurus/docs/dev-docs/data-management.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Occasionally, you need to move data out of or into a Strapi instance. This is po
16
16
17
17
- Use [`strapi export`](/dev-docs/data-management/export) to create a data backup, for archive purposes or to import it in another instance.
18
18
- Use [`strapi import`](/dev-docs/data-management/import) to restore data from a backup.
19
-
- Use [`strapi transfer`](/dev-docs/data-management/transfer) to transfer data from a local to a remote Strapi instance.
19
+
- Use [`strapi transfer`](/dev-docs/data-management/transfer) to transfer data between local and/or remote instances.
20
20
21
21
The following documentation gives explanations and examples for the export, import, and transfer commands, while the [CLI reference documentation](/dev-docs/cli#strapi-export) lists all available flags in a condensed format.
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 between:
9
+
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:
10
10
11
-
- a local Strapi instance and a remote Strapi instance,
12
-
- a remote Strapi instance and another remote Strapi instance.
11
+
-from a local Strapi instance to a remote Strapi instance
12
+
-from a remote Strapi instance to a local Strapi instance
13
13
14
14
:::caution
15
15
@@ -20,16 +20,22 @@ The `strapi transfer` command streams your data from one Strapi instance to anot
20
20
21
21
The CLI command consists of the following arguments:
|`--to`| Full URL of the `/admin` endpoint on the destination Strapi instance<br />(e.g. `--to https://my-beautiful-strapi-website/admin`) |
26
+
|`‑‑to‑token`| Transfer token from the Strapi destination instance. |
27
+
|`--from`| Full URL of the `/admin` endpoint of the remote Strapi instance to pull data from (e.g., `--from https://my-beautiful-strapi-website/admin`) |
28
+
|`‑‑from‑token`| Transfer token from the Strapi source instance. |
29
+
|`--force`| Automatically answer "yes" to all prompts, including potentially destructive requests, and run non-interactively. |
30
+
|`--exclude`| Exclude data using comma-separated data types. The available types are: `content`, `files`, and `config`. |
31
+
|`--only`| Include only these data. The available types are: `content`, `files`, and `config`. |
32
+
33
+
:::caution
34
+
Either `--to` or `--from` is required.
35
+
:::
30
36
31
37
:::tip
32
-
Data transfers are authorized by Transfer tokens, which are generated in the Admin panel. From the Admin panel you can manage role-based permissions to tokens including `view`, `create`, `read`, `regenerate` and `delete`. See the [User Guide](/user-docs/settings/managing-global-settings#creating-a-new-transfer-token) for details on how to create and manage Transfer tokens.
38
+
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`.
33
39
:::
34
40
35
41
## Generate a transfer token
@@ -38,42 +44,80 @@ Data transfers are authorized by Transfer tokens, which are generated in the Adm
38
44
A salt transfer token should be defined in the [admin panel configuration](/dev-docs/configurations/admin-panel) file.
39
45
:::
40
46
41
-
The `strapi transfer` command requires a Transfer token issued by the destination instance. To generate a Transfer token in the Admin panel use the instructions in the [User Guide](/user-docs/settings/managing-global-settings#creating-a-new-transfer-token).
47
+
The `strapi transfer` command requires a transfer token issued by the destination instance. To generate a transfer token in the admin panel use the instructions in the [User Guide](/user-docs/settings/managing-global-settings#creating-a-new-transfer-token).
42
48
43
49
## Setup and run the data transfer
44
50
45
-
To initiate a data transfer:
51
+
Initiating a data transfer depends on whether you want to push data to a remote instance or to pull data from the remote:
46
52
47
-
1. Start the Strapi server for the destination instance.
48
-
2. In a new terminal window, navigate to the root directory of the source instance.
49
-
3. Run the following minimal command to initiate the transfer:
53
+
<Tabs>
50
54
51
-
<TabsgroupId="yarn-npm">
55
+
<TabItemvalue="push"label="Push data to remote">
52
56
53
-
<TabItemvalue="yarn"label="yarn">
57
+
1. Start the Strapi server for the destination instance.
58
+
2. In a new terminal window, navigate to the root directory of the source instance.
59
+
3. Run the following minimal command to initiate the transfer:
54
60
55
-
```bash
56
-
yarn strapi transfer --to destination URL
57
-
```
61
+
<TabsgroupId="yarn-npm">
58
62
59
-
</TabItem>
63
+
<TabItemvalue="yarn"label="yarn">
60
64
61
-
<TabItemvalue="npm"label="npm">
65
+
```bash
66
+
yarn strapi transfer --to destinationURL
67
+
```
62
68
63
-
```bash
64
-
npm run strapi transfer -- --to destination URL
65
-
```
69
+
</TabItem>
70
+
71
+
<TabItem value="npm" label="npm">
72
+
73
+
```bash
74
+
npm run strapi transfer -- --to destinationURL
75
+
```
76
+
77
+
</TabItem>
78
+
79
+
</Tabs>
80
+
81
+
4. Add the transfer token when prompted to do so.
82
+
5. Answer **Yes** or **No** to the CLI prompt: "The transfer will delete all of the remote Strapi assets and its database. Are you sure you want to proceed?"
66
83
67
84
</TabItem>
68
85
69
-
</Tabs>
86
+
<TabItem value="pull" label="Pull data from remote">
87
+
88
+
1. Start the Strapi server for the source instance.
89
+
2. In a new terminal window, navigate to the root directory of the destination instance.
90
+
3. Run the following minimal command to initiate the transfer:
91
+
92
+
<Tabs groupId="yarn-npm">
93
+
94
+
<TabItem value="yarn" label="yarn">
95
+
96
+
```bash
97
+
yarn strapi transfer --from remoteURL
98
+
```
70
99
71
-
4. Add the Transfer token when prompted to do so.
72
-
5. Answer **Yes** or **No** to the CLI prompt: "The transfer will delete all data in the remote database and media files. Are you sure you want to proceed?"
100
+
</TabItem>
101
+
102
+
<TabItem value="npm" label="npm">
103
+
104
+
```bash
105
+
npm run strapi transfer -- --from remoteURL
106
+
```
107
+
108
+
</TabItem>
109
+
110
+
</Tabs>
111
+
112
+
4. Add the transfer token when prompted to do so.
113
+
5. Answer **Yes** or **No** to the CLI prompt: "The transfer will delete all of the local Strapi assets and its database. Are you sure you want to proceed?".
114
+
115
+
</TabItem>
116
+
</Tabs>
73
117
74
118
## Bypass all `transfer` command line prompts
75
119
76
-
When using the `strapi transfer` command, you are required to confirm that the transfer will delete the existing database contents. The `--force` flag allows you to bypass this prompt. This option is useful for implementing `strapi transfer` programmatically. You must pass the `to-token` option with the Transfer token if you use the `--force` option.
120
+
When using the `strapi transfer` command, you are required to confirm that the transfer will delete the existing database contents. The `--force` flag allows you to bypass this prompt. This option is useful for implementing `strapi transfer` programmatically. You must pass the `to-token` option with the transfer token if you use the `--force` option.
77
121
78
122
:::caution
79
123
The `--force` option bypasses all warnings about content deletion.
@@ -159,7 +203,7 @@ Any types excluded from the transfer will be deleted in your destination instanc
159
203
160
204
## Manage data transfer with environment variables
161
205
162
-
The environment variable `STRAPI_DISABLE_REMOTE_DATA_TRANSFER` is available to disable remote data transfer. In addition to the [RBAC permissions](/user-docs/users-roles-permissions/configuring-administrator-roles#plugins-and-settings) in the Admin panel this can help you secure your Strapi application. To use `STRAPI_DISABLE_REMOTE_DATA_TRANSFER` you can add it to your `.env` file or preface the `start` script. See the following example:
206
+
The environment variable `STRAPI_DISABLE_REMOTE_DATA_TRANSFER` is available to disable remote data transfer. In addition to the [RBAC permissions](/user-docs/users-roles-permissions/configuring-administrator-roles#plugins-and-settings) in the admin panel this can help you secure your Strapi application. To use `STRAPI_DISABLE_REMOTE_DATA_TRANSFER` you can add it to your `.env` file or preface the `start` script. See the following example:
Copy file name to clipboardExpand all lines: docusaurus/docs/user-docs/settings/managing-global-settings.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,15 +150,15 @@ To regenerate an API token:
150
150
* The *Global settings > Transfer Tokens* sub-section of the settings interface is accessible in the admin panel only if the _Transfer tokens > Read_ permission is granted.
151
151
:::
152
152
153
-
Transfer tokens allow users to authorize the `strapi transfer` CLI command (see [Developer Documentation](/dev-docs/data-management#transfer)). Administrators can manage API tokens through the *Global settings > Transfer Tokens* sub-section of the settings interface.
153
+
Transfer tokens allow users to authorize the `strapi transfer` CLI command (see [Developer Documentation](/dev-docs/data-management/transfer)). Administrators can manage API tokens through the *Global settings > Transfer Tokens* sub-section of the settings interface.
The *Transfer Tokens* settings sub-section displays a table listing all of the created Transfer tokens.
158
158
159
159
The table displays each Transfer token's name, description, date of creation, and date of last use. From the table, administrators can also:
160
160
161
-
- Click on the edit button <!-- icon --> to edit an Transfer token's name, description, type, duration or [regenerate the token](#regenerating-a-transfer-token).
161
+
- Click on the edit button <!-- icon --> to edit a transfer token's name, description, or type, or [regenerate the token](#regenerating-a-transfer-token).
162
162
- Click on the delete button <!-- icon --> to delete a Transfer token.
163
163
164
164
### Creating a new transfer token
@@ -173,6 +173,7 @@ To create a new Transfer token:
173
173
| Name | Write the name of the Transfer token. |
174
174
| Description | (optional) Write a description for the Transfer token. |
175
175
| Token duration | Choose a token duration: *7 days*, *30 days*, *90 days*, or *Unlimited*. |
176
+
| Token type | Choose a token type:<ul><li>*push* to allow transfers from local to remote instances only,</li><li>*pull* to allow transfers from remote to local instances only,</li><li>or *full access* to allow both types of transfer.</li></ul> |
176
177
177
178
3. Click on the **Save** button. The new Transfer token will be displayed at the top of the interface, along with a copy button <!-- icon -->.
0 commit comments