1

What is the best practice for the following:

Client site running CraftCMS (v3) is in production. Updates are needed which require additions or modifications to the data structure / schema of the site (new sections, fields, etc.). Taking a remote dump of the database for local development is not a realistic option as the client makes regular updates to the website in production. Particularly for new additions, is there a way to easily make those updates in production after I've completed them in my development environment?

Real scenario: I'm adding a new section (a blog) to add to an existing Craft site. I will be working in the development environment for several days, making many additions to the data structure / schema, which I'd prefer not to have to replicate via the admin UI in production once I'm ready to deploy.

Note: I do not want to sync the entire databases - just the structure.

  • Would it be too much work to insert your fields, sections, entrytypes, fieldlayouts and fieldlayoutsfields table to the other database? If you need it more often you could also create a plugin that exports and imports those values via json – Robin Schambach Jun 30 '18 at 6:09
  • @RobinSchambach great, in theory, but yes more work than seems reasonable. I am looking into the content migrations concept from yii as a potential solution, utilizing the "Migration Manager" plugin to make things a bit easier, because I'm not about to write the migration scripts for all of this. Perhaps this is the solution I'm looking for? – Cmagb Jun 30 '18 at 23:00
  • I wouldn't say it's much work to check 6 select boxes in your DB interface and click on export and import it to your other DB - and an additional step for the content table. A content migration concept by yii2 is much more work since it's only a framework – Robin Schambach Jun 30 '18 at 23:04
1

You could use https://github.com/Pennebaker/craft-architect to export your new sections/entry types/fields from your development environment once you're done, and then import them (without content) to production.

  • Great idea. I'll give this a shot. I'm also looking into content migrations as "the" potential solution to this issue, with the help of the "Migration Manager" plugin. – Cmagb Jun 30 '18 at 23:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.