{"id":61023,"date":"2020-10-20T11:25:20","date_gmt":"2020-10-20T14:25:20","guid":{"rendered":"https:\/\/powertic.com\/?p=61023"},"modified":"2021-01-29T17:53:34","modified_gmt":"2021-01-29T20:53:34","slug":"how-update-mautic-command-line","status":"publish","type":"post","link":"https:\/\/powertic.com\/en\/how-update-mautic-command-line\/","title":{"rendered":"How to Update Mautic from the Command Line"},"content":{"rendered":"<p>Updating Mautic often makes your stomach feel chilly. With the arrival of version 2.0 the development team offered a new way to update the platform somewhat different from what we already presented here in this video at the time of version 1.4.<\/p>\n\n\n\n<p>With this new command, we gained more stability and consistency when updating database migrations, the script also clears the cache folder and corrects some file permissions.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>This command applies to all Mautic since version 2.0.<\/p><\/blockquote>\n\n\n\n<p>Basically the process consists of downloading a php script and running this script inside the root folder of your installation. Let's go step by step?<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Important: Run a backup of your files and database before upgrading.<\/p><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Downloading the upgrade.php script to update mautic<\/h2>\n\n\n\n<p>Open your terminal and connect to your VPS. Now open the folder where your Mautic is installed. Look:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"941\" height=\"597\" src=\"https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo01.png\" alt=\"\" class=\"wp-image-61026\" title=\"\" srcset=\"https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo01.png 941w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo01-300x190.png 300w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo01-768x487.png 768w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo01-624x396.png 624w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo01-600x381.png 600w\" sizes=\"auto, (max-width: 941px) 100vw, 941px\" \/><\/figure>\n\n\n\n<p>Now type the command below to download the Mautic update script:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wget&nbsp;https:\/\/github.com\/mautic\/mautic\/raw\/staging\/upgrade.php\n<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"976\" height=\"620\" src=\"https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo02.png\" alt=\"\" class=\"wp-image-61028\" title=\"\" srcset=\"https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo02.png 976w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo02-300x191.png 300w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo02-768x488.png 768w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo02-624x396.png 624w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo02-600x381.png 600w\" sizes=\"auto, (max-width: 976px) 100vw, 976px\" \/><\/figure>\n\n\n\n<p>You will have an output like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"650\" src=\"https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo3.png\" alt=\"\" class=\"wp-image-61030\" title=\"\" srcset=\"https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo3.png 1000w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo3-300x195.png 300w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo3-768x499.png 768w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo3-624x406.png 624w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo3-600x390.png 600w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Update Mautic<\/h2>\n\n\n\n<p>Now that you have the script in the Mautic root folder, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">php upgrade.php<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"989\" height=\"632\" src=\"https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo04.png\" alt=\"\" class=\"wp-image-61032\" title=\"\" srcset=\"https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo04.png 989w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo04-300x192.png 300w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo04-768x491.png 768w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo04-624x399.png 624w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo04-600x383.png 600w\" sizes=\"auto, (max-width: 989px) 100vw, 989px\" \/><\/figure>\n\n\n\n<p>Wait for the progress of the update which takes a few seconds and that's it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1010\" height=\"671\" src=\"https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo05.png\" alt=\"\" class=\"wp-image-61034\" title=\"\" srcset=\"https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo05.png 1010w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo05-300x199.png 300w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo05-768x510.png 768w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo05-624x415.png 624w,  https:\/\/powertic.com\/wp-content\/uploads\/2020\/09\/passo05-600x399.png 600w\" sizes=\"auto, (max-width: 1010px) 100vw, 1010px\" \/><\/figure>\n\n\n\n<p>Your Mautic is up to date but we still have one last step to make sure everything works perfectly!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Updating permissions after updating Mautic<\/h2>\n\n\n\n<p>Finally, don't forget to reset the folder permissions. In our case we use Digital Ocean and by default a LAMP machine uses the user \u201c<strong>www-data<\/strong>\u201d and also the group \u201c<strong>www-data<\/strong>\u201d to access the files via apache. <strong>Type the command below into the mautic folder:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">chown -R www-data:www-data .\nchmod -R g+rw .<\/pre>\n\n\n\n<p>Now you can use Mautic without any problems. Be sure to check out our Guide to Updating the Cache and Adjusting Mautic Permissions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Updating the database schema<\/h2>\n\n\n\n<p>Another factor that can help upgrade problems is to update the database schema on the command line.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Updating Mautic often makes your stomach feel chilly. With the arrival of version 2.0 the development team offered a new way to update the platform&hellip;<\/p>","protected":false},"author":4,"featured_media":61041,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-61023","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-artigos-mautic"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/powertic.com\/en\/wp-json\/wp\/v2\/posts\/61023","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/powertic.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/powertic.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/powertic.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/powertic.com\/en\/wp-json\/wp\/v2\/comments?post=61023"}],"version-history":[{"count":0,"href":"https:\/\/powertic.com\/en\/wp-json\/wp\/v2\/posts\/61023\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/powertic.com\/en\/wp-json\/wp\/v2\/media\/61041"}],"wp:attachment":[{"href":"https:\/\/powertic.com\/en\/wp-json\/wp\/v2\/media?parent=61023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/powertic.com\/en\/wp-json\/wp\/v2\/categories?post=61023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/powertic.com\/en\/wp-json\/wp\/v2\/tags?post=61023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}