Skip to content

Commit 2477718

Browse files
authored
Merge pull request #1369 from strapi/main
Production: DEITS beta release
2 parents e0d2e1f + 381d90f commit 2477718

File tree

5 files changed

+248
-5
lines changed

5 files changed

+248
-5
lines changed

docs/.vuepress/config/sidebar-developer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ const developer = [
323323
['/developer-docs/latest/developer-resources/error-handling.html', 'Error handling'],
324324
['/developer-docs/latest/developer-resources/unit-testing', 'Unit testing'],
325325
['/developer-docs/latest/developer-resources/database-migrations.html', 'Database migrations'],
326+
['/developer-docs/latest/developer-resources/data-management.html', 'Data Management System'],
326327
{
327328
title: 'Integrations',
328329
path: '/developer-docs/latest/developer-resources/content-api/integrations.html',

docs/developer-docs/latest/developer-resources/cli/CLI.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,55 @@ strapi watch-admin
9898
options: [--browser <name>]
9999
```
100100

101+
102+
## strapi export <BetaBadge />
103+
104+
[Exports your project data](/developer-docs/latest/developer-resources/data-management.md). The default settings create a `.tar` file, compressed using `gzip` and encrypted using `aes-128-ecb`.
105+
106+
```bash
107+
strapi export
108+
```
109+
110+
The exported file is automatically named using the format `export_YYYYMMDDHHMMSS` with the current date and timestamp. Alternately, you can specify the filename using the `-f` or `--file` flag. The following table provides all of the available options as command line flags:
111+
112+
| Option | Type | Description |
113+
|------------------|---------|----------------------------------------------------------------------------|
114+
| `--no-encrypt` | - | Disables file encryption and disables the `key` option. |
115+
| `--no-compress` | - | Disables file compression. |
116+
| `-k`, `--key` | string | Passes the encryption key as part of the `export` command. <br/> The `--key` option can't be combined with `--no-encrypt`. | |
117+
| `-f`, `--file` | string | Specifies the export filename. Do not include a file extension. |
118+
| `-h`, `--help` | - | Displays help for the `strapi export` command. |
119+
120+
**Examples**
121+
122+
```bash
123+
# examples of strapi export:
124+
125+
strapi export -f myData # exports your data with the default options and the filename myData (which will result in a file named myData.tar.gz.enc)
126+
strapi export --no-encrypt # exports your data without encryption.
127+
```
128+
129+
## strapi import <BetaBadge />
130+
131+
[Imports data](/developer-docs/latest/developer-resources/data-management.md) into your project. The imported data must originate from another Strapi application. You must pass the `--file` option to specify the filename and location for the import action.
132+
133+
| Option | Type | Description |
134+
|--------------------|--------|---------------------------------------------------------------------------|
135+
| `-k,` `--key` | string | Provide the encryption key in the command instead of a subsequent prompt. |
136+
| `-f`, `--file` | string | Path and filename with extension for the data to be imported. |
137+
| `-h`, `--help` | - | Display the `strapi import` help commands. |
138+
139+
**Examples**
140+
141+
```bash
142+
143+
# example of strapi import:
144+
145+
# import your data with the default parameters and pass an encryption key:
146+
strapi import -f <your-filepath-and-filename> --key my-key
147+
148+
```
149+
101150
## strapi configuration:dump
102151

103152
**Alias**: `config:dump`
@@ -106,7 +155,7 @@ Dumps configurations to a file or stdout to help you migrate to production.
106155

107156
The dump format will be a JSON array.
108157

109-
```
158+
```sh
110159
strapi configuration:dump
111160

112161
Options:
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
---
2+
title: Data Management System - Strapi Developer Docs
3+
description: Import, export, and transfer data using the Strapi CLI
4+
sidebarDepth: 3
5+
canonicalUrl: https://docs.strapi.io/developer-docs/latest/development/export-import.html
6+
---
7+
8+
# Data Management System <BetaBadge />
9+
10+
:::callout 🚧 Feature under development
11+
The data management system is under development. Not all use cases are covered by the initial release. You can provide feedback about desired functionality on the [Strapi feedback website](https://feedback.strapi.io).
12+
:::
13+
14+
Occasionally you need to move data out of or into a Strapi instance. The data management system allows you to efficiently extract data from an existing instance or archive and import that data into a separate instance. Strapi provides CLI-based commands that allow you to export and import data. Common use cases include:
15+
16+
- creating a data backup,
17+
- restoring data from a backup.
18+
19+
The following documentation details examples of how to use the `strapi export` and `strapi import` commands.
20+
21+
:::strapi Using the Command Line Interface (CLI)
22+
The `strapi export` and `strapi import` CLI commands with all of the available options are listed in the [Command Line Interface documentation](/developer-docs/latest/developer-resources/cli/CLI.md#strapi-export).
23+
:::
24+
25+
## Export data using the CLI tool
26+
27+
The `strapi export` command by default exports data as an encrypted and compressed `tar.gz` file. The default export command exports:
28+
29+
- the project configuration,
30+
- entities: all of your content,
31+
- links: relations between your entities,
32+
- assets: files stored in the uploads folder,
33+
- schemas,
34+
- the `metadata.json` file.
35+
36+
:::caution
37+
Admin users and API tokens are not exported.
38+
:::
39+
40+
### Name the export file
41+
42+
Exported data are contained in a `.tar` file that is automatically named using the format `export_YYYYMMDDHHMMSS`. You can optionally name the exported file by passing the `--file` or `-f` option with the `strapi export` command. Do not include a file extension.
43+
44+
#### Example: Export data with a custom filename
45+
<br/>
46+
<code-group>
47+
<code-block title="YARN">
48+
49+
```bash
50+
yarn strapi export --file my-strapi-export
51+
```
52+
53+
</code-block>
54+
55+
<code-block title="NPM">
56+
57+
```bash
58+
npm strapi export --file my-strapi-export
59+
```
60+
61+
</code-block>
62+
</code-group>
63+
64+
### Configure data encryption
65+
66+
The default `strapi export` command encrypts your project data using `aes-128-ecb` encryption and adds the file extension `.enc`. To use encryption you need to pass an encryption key using the `-k` or `--key` option or enter an encryption key when prompted. The encryption key is a `string` with no minimum character count.
67+
68+
:::tip Encryption keys
69+
Strong encryption keys are encouraged to protect sensitive data in your project. [OpenSSL](https://www.openssl.org/) is a resource for generating encryption keys.
70+
:::
71+
72+
To disable encryption, pass the `--no-encrypt` option with the `strapi export` command.
73+
74+
#### Example: Export data without encryption
75+
76+
<br/>
77+
<code-group>
78+
<code-block title="YARN">
79+
80+
```bash
81+
yarn strapi export --no-encrypt
82+
```
83+
84+
</code-block>
85+
86+
<code-block title="NPM">
87+
88+
```bash
89+
npm strapi export --no-encrypt
90+
```
91+
92+
</code-block>
93+
</code-group>
94+
95+
#### Example: Export data with the encryption `--key` option
96+
97+
<br/>
98+
<code-group>
99+
<code-block title="YARN">
100+
101+
```bash
102+
yarn strapi export --key my-encryption-key
103+
```
104+
105+
</code-block>
106+
107+
<code-block title="NPM">
108+
109+
```bash
110+
npm strapi export --key my-encryption-key
111+
```
112+
113+
</code-block>
114+
</code-group>
115+
116+
### Disable data compression
117+
118+
The default `strapi export` command compresses your project data using `gzip` compression and adds the `.gz` file extension.
119+
120+
To disable compression, pass the `--no-compress` option with the `strapi export` command.
121+
122+
#### Example: Export data without compression
123+
<br/>
124+
<code-group>
125+
<code-block title="YARN">
126+
127+
```bash
128+
yarn strapi export --no-compress
129+
```
130+
131+
</code-block>
132+
133+
<code-block title="NPM">
134+
135+
```bash
136+
npm strapi export --no-compress
137+
```
138+
139+
</code-block>
140+
</code-group>
141+
142+
## Import data using the CLI tool
143+
144+
:::warning
145+
`strapi import` will delete all of the existing data prior to importing the backup file. Restored data does not include the `users` table, which means that `createdBy` and `updatedBy` are empty in a restored instance.
146+
:::
147+
148+
To import data into a Strapi instance use the `strapi import` command in the project root directory. Specify the file to be imported using the `-f` or `--file` option. The filename, extension, and path are required. If the file is encrypted, you will be prompted for the encryption key before the import starts.
149+
150+
#### Example: Minimum command to import data from a file in the Strapi project root
151+
<br/>
152+
<code-group>
153+
<code-block title="YARN">
154+
155+
```bash
156+
yarn strapi import -f export_20221213105643.tar.gz.enc
157+
```
158+
159+
</code-block>
160+
161+
<code-block title="NPM">
162+
163+
```bash
164+
npm strapi import -f export_20221213105643.tar.gz.enc
165+
```
166+
167+
</code-block>
168+
</code-group>
169+
170+
### Provide an encryption key
171+
172+
If you are importing data from an encrypted file the encryption key can be passed with the `strapi import` command by using the `-k` or `--key` option.
173+
174+
#### Example: Pass the encryption key with the `strapi import` command
175+
<br/>
176+
<code-group>
177+
<code-block title="YARN">
178+
179+
```bash
180+
yarn strapi import -f export_20221213105643.tar.gz.enc --key my-encryption-key
181+
```
182+
183+
</code-block>
184+
185+
<code-block title="NPM">
186+
187+
```bash
188+
npm strapi import -f export_20221213105643.tar.gz.enc --key my-encryption-key
189+
```
190+
191+
</code-block>
192+
</code-group>

docs/developer-docs/latest/plugins/sentry.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Sentry - Strapi Developer Docs
3-
description: Send email from your server or externals providers.
4-
canonicalUrl: https://docs.strapi.io/developer-docs/latest/plugins/email.html
3+
description: Track errors in your Strapi application.
4+
canonicalUrl: https://docs.strapi.io/developer-docs/latest/plugins/sentry.html
55
---
66

77
# Sentry

docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.4.5-to-4.5.1.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ To remove the duplicated relationships easily, the following migration script fi
6060
To prepare the migration:
6161

6262
1. Make a backup of the database in case something unexpected happens.
63-
2. In the `./database/migrations` folder, create a file named `2022.11.16T00.00.00.remove_duplicated_relationships.js`.
64-
3. Copy and paste the following code into the previously created file:
63+
2. Make sure you are migrating from a version greater than or equal to 4.4.5. If not, please migrate to the 4.4.5 version first, else this script will not work.
64+
3. In the `./database/migrations` folder, create a file named `2022.11.16T00.00.00.remove_duplicated_relationships.js`.
65+
4. Copy and paste the following code into the previously created file:
6566

6667
```jsx
6768
'use strict';

0 commit comments

Comments
 (0)