Sprout Forms will be adding support for Project Config in Craft 3.1. At the time of this posting the Craft Project Config has not yet been released, the Project Config will likely give us a much better workflow to maintain plugin settings between environments.
While there is an alternative, the export/import path described below would be a bit tedious to maintain and could just be easier to do manually depending on how many Forms you need to migrate (as you will have to define those forms in the export JSON to get them exported).
Sprout Forms has a Sprout Import integration and supports importing
Form and Form
Entry Elements via the Sprout Import Element Importer API.
With the Sprout Forms/Sprout Import integration you could:
- Create a Twig template or script that outputs your Forms (and/or Entries) to a JSON file
- Create a Migration that grabs that JSON export and hands it off to Sprout Import to import.
This import can be triggered using the Sprout Import service layer or via a console command.
./craft sprout/import/run --file="@root/import.json"
More on importing forms using this API: https://sprout.barrelstrengthdesign.com/docs/forms/importing-data.html#forms