API Monorepo to Instance

This guide explains how to move a system that is defined in the brezel/api repository under database/seeds/<system> to a separate repository.

1. Set up a new Brezel instance

  1. Follow the Installation guide to install a new Brezel instance.
  2. Complete the Setup guide.

2. Copy system assets

  1. In the systems directory, delete the examples directory and copy the database/seeds/<system> directory to this location.
  2. In the brezel/spa repository, copy the contents of public/systems/<system> to the public/assets directory in your new instance.

2. Deploy the Brezel instance

  1. Depending on the desired deployment target, follow the Deployment guide to deploy your Brezel instance on your server or cluster.

3. Copy the database

  1. Use mysqldump to export the existing system database on the brezel.io VM:
mysqldump -u api.brezel -p brezel_api_<system> > brezel_api_<system>.sql
  1. Upload the brezel_api_<system>.sql to your deployment target.
  2. If the system database on your deployment target was already created in the deployment or setup step, and no relevant data is there, drop the system database. It is usually called brezel_<system>.
  3. Create the database brezel_<system> again.
  4. Import the database:
mysql -uroot -p brezel_<system> < brezel_api_<system>.sql

This might take a few minutes.

4. Delete the old system

  1. In the brezel.io VM, delete the system:
php artisan brezel:system delete <system>
  1. In the brezel/api repository, delete the databse/seeds/<system> directory.