What is the best way to bootstrap role permission config on new server

System Information
  • Strapi Version: v4
  • Operating System:
  • Database: mysql
  • Node Version: 16
  • NPM Version:
  • Yarn Version:

i am new with strapi v4.

i want when i create a new server it should have default admin user and and role permission config.

Now i need create a new admin and and role config by hand :frowning:
Thank


1 Like

Hey @Le_Trieu,

You can use the config-sync plugin that I wrote.

After you install it in your local Strapi instance you can export the permissions (and other config) to JSON files. Then you can add the files to git and import them on any other env.

Importing & exporting can be done through the CLI or Strapi admin GUI.

To bootstrap the admin user you can use this snippet in the bootstrap function of your Strapi project.

1 Like

thank you.
your plugin config-sync is working perfect for me.