Now that you have installed the new database package, you need to update your `database.json` configuration files located in `./config/environments/{env}/database.json`.
You can now only use the connector name instead of the complete package name.
:::: tabs
::: tab bookshelf
**Before**
```json
{
"defaultConnection": "default",
"connections": {
"default": {
"connector": "strapi-hook-bookshelf",
"settings": {
//...
},
"options": {}
}
}
}
```
**After**
```json
{
"defaultConnection": "default",
"connections": {
"default": {
"connector": "bookshelf",
"settings": {
//...
},
"options": {
//...
}
}
}
}
```
:::
::: tab mongoose
**Before**
```json
{
"defaultConnection": "default",
"connections": {
"default": {
"connector": "strapi-hook-mongoose",
"settings": {
//...
},
"options": {}
}
}
}
```
**After**
```json
{
"defaultConnection": "default",
"connections": {
"default": {
"connector": "mongoose",
"settings": {
//...
},
"options": {
//...
}
}
}
}
```
:::
::::
## Adding new root page files
We have created new home pages for your api url.
You will need to copy `index.html` and `production.html` into your `public` folder.
You can find those two files [here](https://github.com/strapi/strapi/tree/master/packages/strapi-generate-new/lib/resources/files/public).
## Updating `csp` options
The admin panel contains certain assets that use `data:img;base64` images. To allow rendering of those assets you can update the files `./config/environments/{env}/security.json` as follows:
**Before**
```json
{
"csp": {
"enabled": true,
"policy": [
{
"img-src": "'self' http:"
},
"block-all-mixed-content"
]
}
//....
}
```
**After**
```json
{
"csp": {
"enabled": true,
"policy": ["block-all-mixed-content"]
}
//....
}
```
If you need more fine control you can also simply add the `data:` option to the `img-src` option.
## `ctx.state.user`
Previously the ctx.state.user was populated with the user informations, its role and permissions. To avoid perfromance issues the role is the only populated relation on the user by default.
## File model
The file model has been updated. The `size` field is now a decimal number, allowing correct sorting behavior.
You will need to clear some database indexes if you are using either MySQL or PostgreSQL.
:::: tabs
::: tab MySQL
Run the following statement in your database:
`DROP INDEX SEARCH_UPLOAD_FILE ON upload_file;`
:::
::: tab PostgreSQL
Run the following statement in your database:
`DROP INDEX search_upload_file_size;`
:::
::::
## Date type changes
We have introduced new types in the admin panel: `date`, `datetime` and `time`. Previously all of those types where saved as `datetime`.
You will need to change the type of your fields from `date` to `datetime` if you don't want to migrate your data.
- To migrate your old `date` to `datetime`, change the field type from `date` to `datetime`. NO data migration is required.
- To migrate your old `date` to new `date`, you will need to migrate your data to be of the format: `YYYY-MM-DD`
- To migrate your old `date` to the new `time`, change the field type from `date` to `time`. You will also need to transform them to be of the format: `HH:mm:ss.SSS`
## Groups become Components
If you were using the groups feature, you will need to apply some changes:
Start by renaming the `./groups` folder to `./components` in your project root folder.
Components now are placed into `categories`. To reflect this you must move your components inside `category` folders.
::: danger
Make sure to use `-` in your file names (Do not use spaces or underscores).
:::
### Example
**Before**
```
groups/
├── seo-metadata.json
└── image-text.json
```
**After**
```
components/
├── seo/
│ └── metadata.json
└── content/
└── image-text.json
```
Now that you have moved your component into categories. You need to update your content-types to reference them correctly.
**3. Update the `component_type` values in the join tables**
_Repeat this query for every join table where you are using this component._
```sql
UPDATE restaurant_components
SET component_type = 'components_new_table_name'
WHERE component_type = 'groups_old_table_name';
```
**4. If you store files in groups, update the `related_type` values**
```sql
UPDATE upload_file_morph
SET related_type = 'components_new_table_name'
WHERE related_type = 'groups_old_table_name';
```
#### Mongo
In `mongo` the relation between a content type and its components is held in an array of references. To know which component type it referes to, the array also contains a `kind` attribute containing the component Schema name.
**How to migrate**
**1. Get your new global ids**
The `kind` attribute references the Strapi `globalId` of a model. To get your component global ids run: