2

Is there any craft command command (shell) which can be used to perform the database updates necessary after a CMS update? (e.g. Craft3 beta-28 to beta29 or multi version updates)

Background: We are deploying our projects with Jenkins and I would want Jenkins to call such a command after each deployment (or after each CMS update). Going to the /admin/ Panel manually to be told that the database needs to be upgraded is not ideal.

5

You can use Yii's migrate console command.

Triggered in Craft 3 via craft migrate --type=app.

  • And just to make sure: nothing else is done in this (normally) manual step than applying the Yii migrations? – Matthias Redl-Mann Oct 13 '17 at 10:16
  • Correct... the updater uses the same logic – Brad Bell Oct 13 '17 at 22:42
  • I just had the change to try it, but it does not work. The website itself currently gives me a 503 "Service unavailable", under /admin/ I get "To complete the update, some changes must be made to your database." – Matthias Redl-Mann Nov 13 '17 at 9:19
  • ... But the manual "craft migrate" still tells me "No new migrations found. Your system is up-to-date." I also tried setting the migration path via "./craft migrate --migrationPath=@vendor/craftcms/cms/src/migrations --interactive=0". Still "no new migrations found": Any ideas? – Matthias Redl-Mann Nov 13 '17 at 9:57
  • My bad... by default it queries for site migrations. Add the --type=app to tell it to look at Craft migrations. – Brad Bell Nov 13 '17 at 18:04

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.