To avoid confusions we have decided to give the same behavior to the `npm run start` and `strapi start` commands. To do so we had to introduce a new `strapi develop` command to run your project in `watch` mode.
You need to remove the `server.autoReload` key in `./config/environments/**/server.json`.
### Bootstrap function
The function exported in `config/functions/bootstrap.js` previously received a callback. This is not the case anymore. You can either use an async function, return a promise or simply run a synchronous function.
One of our main objectives for the `beta` is to make it easier and quicker to upgrade to more recent versions of Strapi. This is why moving forward, plugins will be located in the `node_modules` folder.
Let's start by creating a new folder called `./extensions`. This folder needs to exist even if it's empty. You may use a `.gitkeep` file to ensure the folder isn't deleted from the repository (if it's empty) when cloning. [More details](https://davidwalsh.name/git-empty-directory).
If you installed a plugin but never modified any files inside `./plugins/pluginName/**/*`, you can remove the `./plugins/pluginName` folder. You may also remove the default installed plugins. This may mean that there are no plugins inside the `./plugins` folder, so you can delete the `./plugins` folder.
**Note:** If you have created a **custom plugin** leave the plugin in the `./plugins` folder. Newly created **custom plugins** are placed in the `./plugins` folder.
Strapi merges the plugin's configurations with the ones in `./extensions/pluginName/config`. Therefore, you should also only add the fields that you modified in your custom configurations files.
If you modified `./plugins/pluginName/config/routes.json` you will have to copy the file to `./extentions/pluginName/config/routes.json` and only keep the routes you customized or added.
All the unchanged routes must be removed from this file.
**Before**
`./plugins/users-permissions/config/routes.json`
```json
{
"routes": [
{
"method": "GET",
"path": "/",
"handler": "UsersPermissions.customIndex",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/init",
"handler": "UsersPermissions.init",
"config": {
"policies": [],
"description": "Check if the first admin user has already been registered",
To migrate controllers and services you must move your customized controllers and services to the `./extensions/pluginName/**/*`, delete all the non customized ones and keep only the methods you modified in your customized files·
For example, if you have a `customIndex` action in the `User` controller you only have to create the `./extensions/users-permissions/controllers/User.js` file and keep your `customIndex` action in it. You can delete the rest of the files and methods.
If you have modified (or created relations) with a plugin's model, you will have to move your Model file to `./extensions/pluginName/models/Model.settings.json`
For custom `controllers` and `services` (the ones without a model) you can leave them untouched.
### Migrating routes
In the file `./api/apiName/config/routes.json` we renamed the `destroy` action to `delete` you will have to update your `routes` and `controller` accordingly.
- If you have not customized anything in `./admin` folder, then simply delete the `./admin` folder and it's contents.
- If you have customized any part of the `./admin` folder, then keep only those modified files, locate their new location in the directory structure ([source code](https://github.com/strapi/strapi/tree/master/packages/strapi-admin/admin)), and then move the files to their new locations.
Customizing the admin is as simple as creating a file in the `./admin` folder of your app. You need to make sure the file you want to customize is at the same location in your `./admin` folder as it is in the `strapi-admin` package. For a reference you can look at the [source code](https://github.com/strapi/strapi/tree/master/packages/strapi-admin/admin).
You can do the same with any file found in the [source code](https://github.com/strapi/strapi/tree/master/packages/strapi-admin/admin) of the admin panel
To run your migrated project you will now need to run `strapi develop` or `npm run develop` to run the project in watch mode (e.g auto reloading on content-type creation).
If you haven't run `strapi develop` or `npm run develop` (as above) and would like to run strapi without watch mode then you need to first run `strapi build` or `npm run build` as a first step, and then run `strapi start` or `npm run start`.
Finally, if you want to run your project in different environments use `NODE_ENV=env npm run start`, eg. `NODE_ENV=production npm run start` or `NODE_ENV=development npm run start`.
The beta introduces a new `Administrator` model created solely to allow user access to the Strapi administration panel (at this time this model is not editable). In this way, the `Administrator` model replaces the previous `User` model from the `users-permissions` plugin.
With this new model, you now have a clear distinction between the people that are allowed to access the administration panel, and the users of the application you built with Strapi.
More practically, it means that a new `strapi_administrator` collection will be created automatically in your database.
On startup, the `strapi_administrator` table is empty, therefore when migrating from alpha to beta, you may either create a new administrator user with the registration page OR you may manually migrate your previous users with `administrator` role.
If you only used the `administrator` role to give access to the admin panel to certain users, and never used this role for your application business logic, you can delete the role from within the admin panel.
If you haven't created any relation with the `User` model in your `Content Types` and don't use those users in your application business logic; you can remove every user you have migrated to the `strapi_administrator` collection.
Finally, if you have chosen to migrate your previous admin users in the new `strapi_administrator` collection but your `User` model has at least one relation with another model, then you may need to keep both the `strapi_administrator` and `users-pemrissions_user` collection manually in sync.
**Example**: Some of your application users can edit their profile and access the admin panel. If they change their email you need to make sure their `administrator` entity also changes email.
If you are deploying your Strapi project with the Admin panel together, you will have to make sure the `build` script runs before running the project. (e.g `npm run build`)
Depending on your deployment environment you might have to run the `build` script with `NODE_ENV=production npm run build` if the environment doesn't include it by default.
Previously, you could run your project by running `node server.js`. The beta version removes the `server.js` file, and so you will have to either run `npm run start` or manually create a `server.js` file (read more [here](#migrating-server.js))
The beta release of Strapi marks an important milestone in the long-term development of the project. Going forward the Strapi Community, their users and clients can continue to use and deploy Strapi with even greater confidence. Thank you for all the contributions that made this beta release possible.