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.

1 Answer 1


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? Commented Oct 13, 2017 at 10:16
  • Correct... the updater uses the same logic
    – Brad Bell
    Commented Oct 13, 2017 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." Commented Nov 13, 2017 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? Commented Nov 13, 2017 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
    Commented Nov 13, 2017 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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