how to migrate voyager stuff to new deploy instance?

5.7k views Asked by At

laravel voyager is cool, but how to migrate these tables\setting\breads from development to product instance? especially for those develop once, deploy multiple time, how could it be done gracefully?

as for laravel, the native database migration/seeder is good for this purpose

3

There are 3 answers

0
Sam On

No way to do it currently. Best hope so far is to export key tables such as those for the menus, bread and roles and then import them in production (making sure maintenance mode is on, of course).

Would be great if they could make a way to store central configuration in a JSON format of some sort so that it can be included in source control.

0
Drudge Rajen On

For Migration, just create migration and run migrate command.

For BREAD, use this package which will listen to the Voyager BREAD (ADD, Update, Delete) Events and will generate the respective seeder file.

0
Matt Rabe On

I recommend using 3rd party tools to generate both migrations and seeds from your existing database tables.

Generate migrations: https://github.com/Xethron/migrations-generator

Generate seeds: https://github.com/orangehill/iseed

Files like DataRowsTableSeeder.php have already been created by Voyager - Iseed will want to overwrite them. If this is not acceptable to you, I have created a fork+pull request which allows you to explicitly specify the file/class name when running Iseed: https://github.com/mattrabe/iseed