notebook for linux, drupal, composer, etc. https://notes.masterweb.sk/ sk c https://notes.masterweb.sk/c <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">c</span> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">ROOT</span></span> <span property="schema:dateCreated" content="2022-01-26T17:05:03+00:00" class="field field--name-created field--type-created field--label-hidden">St, 01/26/2022 - 18:05</span> Wed, 26 Jan 2022 17:05:03 +0000ROOT164 at https://notes.masterweb.skhttps://notes.masterweb.sk/c#comments composer update 8.7.x to 8.8.5 (raw) https://notes.masterweb.sk/composer-drush/composer-update-87x-885-raw <span class="field field--name-title field--type-string field--label-hidden">composer update 8.7.x to 8.8.5 (raw)</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">ROOT</span></span> <span class="field field--name-created field--type-created field--label-hidden">Ut, 04/28/2020 - 18:54</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><pre> composer update drupal/* --with-dependencies --dry-run drush updb drush cr </pre> <p>chmod +w web/sites/default<br /> chmod 777 web/sites/default/settings.php<br /> <strong>add missing line into settings.php -&gt; $settings["file_temp_path"] = "tmp";</strong><br />   394  composer update drupal/pathauto --with-dependencies --dry-run<br />   397  composer outdated drupal/*<br /> <strong>composer update drupal/pathauto --with-dependencies (must be at least 1.6)</strong><br />   399  drush updb<br />   400  drush cr<br /> <strong>composer remove --dev webflo/drupal-core-require-dev</strong><br />   402  composer outdated drupal/*<br />   403  composer update drupal/core --with-dependencies --dry-run<br /> <strong>composer update drupal/core --with-dependencies</strong><br />   405  drush updb<br />   406  drush cr<br />   407  composer outdated drupal/*<br />   408  composer update drupal/* --with-dependencies --dry-run<br />   428  composer outdated drupal/*<br />   429  composer update drupal/* --with-dependencies --dry-run<br />   430  composer update drupal/* --with-dependencies<br />   431  drush updb<br />   432  drush cr<br />   433  nano composer.json<br />   434  mc<br />   435  composer outdated drupal/*<br />   436  nano composer.json<br /> <strong>composer require 'drupal/admin_toolbar:^2.2' --no-update</strong><br />   438  composer update drupal/admin_toolbar --with-dependencies --dry-run<br />   439  nano composer.json<br /> <strong>composer update drupal/admin_toolbar --with-dependencies</strong><br />   441  drush updb<br />   442  drush cr<br />   443  composer outdated drupal/*<br />   444  composer require 'drupal/webform:^5.10' --no-update<br />   445  composer update drupal/webform --with-dependencies<br />   446  drush updb<br />   447  drush cr</p> <p> </p> <p>SOME REFERENCES:<br /> <a href="https://www.palantir.net/blog/guide-drupal-8-8-update">https://www.palantir.net/blog/guide-drupal-8-8-update</a><br /> <a href="https://www.drupal.org/docs/updating-drupal/update-drupal-core-via-composer#migrate-webflo-drupal-core-strict-to-core-recommended">https://www.drupal.org/docs/updating-drupal/update-drupal-core-via-composer#migrate-webflo-drupal-core-strict-to-core-recommended</a><br /> <a href="https://www.drupal.org/forum/support/upgrading-drupal/2019-12-06/upgrade-from-8710-to-880-with-composer">https://www.drupal.org/forum/support/upgrading-drupal/2019-12-06/upgrade-from-8710-to-880-with-composer</a></p> </div>Tue, 28 Apr 2020 16:54:46 +0000ROOT120 at https://notes.masterweb.sk WP CLI commands https://notes.masterweb.sk/wp/wp-cli-commands <span class="field field--name-title field--type-string field--label-hidden">WP CLI commands</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">ROOT</span></span> <span class="field field--name-created field--type-created field--label-hidden">Po, 04/22/2019 - 00:52</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><pre> wp core check-update wp cache flush wp plugin list wp plugin update --all --dry-run wp plugin update --all wp core update # <a href="https://developer.wordpress.org/cli/commands/core/update/">https://developer.wordpress.org/cli/commands/core/update/ </a>wp core update-db wp theme update --all --dry-run wp theme update --all wp --info wp core download wp plugin install elementor wp plugin install elementor --activate wp plugin install duplicator --activate wp core version </pre> <p>DB EXPORT:</p> <p>wp db export<br /> wp db export ../db_name.sql</p> <p>SEARCH and REPLACE in DB (search -&gt; replace):</p> <p>wp search-replace 'AAAAA' 'BBBBB' --skip-columns=guid --dry-run<br /> wp search-replace 'AAAAA' 'BBBBB' --skip-columns=guid</p> <p>WP DOCTOR:</p> <p>wp package install <a href="mailto:git@github.com">git@github.com</a>:wp-cli/doctor-command.git</p> <p>wp doctor<br /> wp doctor check --all</p> <p><a href="https://www.wpoven.com/blog/the-complete-guide-to-master-wp-cli-wp-cli-install-commands/">https://www.wpoven.com/blog/the-complete-guide-to-master-wp-cli-wp-cli-install-commands/</a></p> <p><a href="https://www.siteground.com/tutorials/wordpress/wp-cli/">https://www.siteground.com/tutorials/wordpress/wp-cli/</a></p> <p> </p> <p> </p> </div><div class="field field--name-field-tags field--type-entity-reference field--label-above clearfix"> <h3 class="field__label">Značky</h3> <ul class="links field__items"> <li><a href="/taxonomy/term/25" hreflang="sk">wp cli</a></li> </ul> </div> Sun, 21 Apr 2019 22:52:36 +0000ROOT51 at https://notes.masterweb.sk CMSeek (good for WP) https://notes.masterweb.sk/cms-detect/cmseek-good-wp <span class="field field--name-title field--type-string field--label-hidden">CMSeek (good for WP)</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">ROOT</span></span> <span class="field field--name-created field--type-created field--label-hidden">So, 04/06/2019 - 23:48</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p><a href="https://github.com/Tuhinshubhra/CMSeeK">https://github.com/Tuhinshubhra/CMSeeK</a></p> <p>know CMS: more than 150</p> <p>D7 and D8 shows just 7.xx or 8.xx version</p> <pre> git clone https://github.com/Tuhinshubhra/CMSeeK cd CMSeeK pip/pip3 install -r requirements.txt</pre> <p>+ make file exetucable chown -x cmseek.py</p> <p><a href="https://linuxize.com/post/how-to-install-python-3-on-centos-7/">https://linuxize.com/post/how-to-install-python-3-on-centos-7/</a></p> <p>in own directory (root/CMSeeK) # python3 cmseek.py -v -u axweb.sk</p> <p>Preparing comma "," separated list from "per line list:</p> <pre> nano input.txt</pre> <p>put here "per line" list of domains, then simply run:</p> <pre> tr '\n' ',' &lt; input.txt &gt; output.txt</pre> <p>Run detecting from list.txt, (<s>at this moment need manual confirmation by pressing ENTER after each domain</s>), -&gt; result are saved in Result/domain/cms.json file:</p> <pre> python3 cmseek.py -l list.txt --follow-redirect python3 cmseek.py -l output.txt --follow-redirect --random-agent --batch --strict-cms wp --skip-scanned </pre> <p>then <a href="https://www.cyberciti.biz/faq/howto-search-find-file-for-text-string/">grep</a> results:</p> <pre> cd Result grep "wp_version" */*.json</pre> <p>and result is domain/cms.json: "wp_version": "x.x.x"</p> <p> </p> <p><img alt="1" data-entity-type="file" data-entity-uuid="ae43b05e-8b08-4b39-9d74-9df047c209ea" src="/sites/default/files/inline-images/2019-04-06_23-52%282%29.png" /></p> <p><img alt="1" data-entity-type="file" data-entity-uuid="243a61d0-6394-49c2-bacc-5178508372bc" src="/sites/default/files/inline-images/2019-04-06_23-59.png" /></p> <p><img alt="1" data-entity-type="file" data-entity-uuid="6bc5d204-5209-468d-ab5a-07dc85b1d0f9" src="/sites/default/files/inline-images/2019-04-06_23-56.png" /></p> <p><img alt="1" data-entity-type="file" data-entity-uuid="fb95e793-84b1-418f-97e4-d162afcdaad8" src="/sites/default/files/inline-images/2019-04-06_23-54.png" /></p> <p> </p> <p><strong>Sources</strong>:</p> <p><a href="https://www.cyberciti.biz/faq/howto-search-find-file-for-text-string/">https://www.cyberciti.biz/faq/howto-search-find-file-for-text-string/</a></p> </div>Sat, 06 Apr 2019 21:48:03 +0000ROOT24 at https://notes.masterweb.sk Composer update / prohibits (core + modules) till D8.6.11 https://notes.masterweb.sk/composer-drush/composer-update-prohibits-core-modules-till-d8611 <span class="field field--name-title field--type-string field--label-hidden">Composer update / prohibits (core + modules) till D8.6.11</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">ROOT</span></span> <span class="field field--name-created field--type-created field--label-hidden">St, 03/13/2019 - 13:03</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><pre> composer outdated drupal/* composer show drupal/* </pre> <p>This manual works till version D8.6.11 (8.6.11 and higher require twig 1.38.2), so need at first update twig to this version with:</p> <pre> composer require 'twig/twig:1.38.2'</pre> <p><strong>Composer prohibits</strong> - zobrazí závislosti, kvôli ktorým update zlyhá:</p> <pre> composer prohibits drupal/core:8.6.15</pre> <p><strong>Composer update</strong> - update modulov podla composer.json</p> <pre> <code>composer update drupal/core webflo/drupal-core-require-dev --with-dependencies --dry-run composer update drupal/core webflo/drupal-core-require-dev --with-dependencies</code> </pre> <p>toto ale updatne aj twig z verzie 1.37.1 na verziu 1.38.xx a tym rozhodi webstranku, preto <strong>vrátime twig na pôvodnú verziu</strong>:<br /> * problem with twig issue was resolved in Drupal <a href="https://www.drupal.org/project/drupal/releases/8.6.11">8.6.11</a> and <a href="https://www.drupal.org/project/drupal/releases/8.6.12">8.6.12</a> </p> <pre> composer require 'twig/twig:1.37.1' drush updb drush cr</pre> <p>Ešte moduly:</p> <pre> composer outdated drupal/* composer update drupal/* --with-dependencies --dry-run drush updb drush cr</pre> <p><em>(takto to zatiaľ fungovalo na test banystav)</em></p> <p> </p> <p><strong>Referencie</strong>:<br /> <a href="https://www.drupal.org/docs/8/update/update-core-via-composer">https://www.drupal.org/docs/8/update/update-core-via-composer</a> - commands<br /> <a href="https://www.jeffgeerling.com/blog/2018/updating-drupalcore-composer-drupal-core-doesnt-update">https://www.jeffgeerling.com/blog/2018/updating-drupalcore-composer-dru…</a> - composer prohibits<br /> <a href="https://www.drupal.org/project/drupal/issues/3039408">https://www.drupal.org/project/drupal/issues/3039408</a> - twig problem</p> </div><div class="field field--name-field-tags field--type-entity-reference field--label-above clearfix"> <h3 class="field__label">Značky</h3> <ul class="links field__items"> <li><a href="/taxonomy/term/4" hreflang="sk">composer</a></li> <li><a href="/taxonomy/term/5" hreflang="sk">composer update</a></li> <li><a href="/taxonomy/term/6" hreflang="sk">composer prohibits</a></li> <li><a href="/taxonomy/term/7" hreflang="sk">drush</a></li> <li><a href="/taxonomy/term/8" hreflang="sk">drush updb</a></li> <li><a href="/taxonomy/term/9" hreflang="sk">drush cr</a></li> <li><a href="/taxonomy/term/10" hreflang="sk">composer require</a></li> <li><a href="/taxonomy/term/11" hreflang="sk">twig</a></li> </ul> </div> Wed, 13 Mar 2019 12:03:10 +0000ROOT8 at https://notes.masterweb.sk WSL run ssh after start https://notes.masterweb.sk/linux-man/wsl-run-ssh-after-start <span class="field field--name-title field--type-string field--label-hidden">WSL run ssh after start</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">ROOT</span></span> <span class="field field--name-created field--type-created field--label-hidden">Po, 01/23/2023 - 17:41</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Add following line/s into file .bashrc on default WSL user:</p> <pre> service cron status || sudo service cron start # optional service ssh status || sudo service ssh start</pre> <p>This will prompt sudo pw after reboot, but it works. Siplest workflow for this.</p> </div>Mon, 23 Jan 2023 16:41:25 +0000ROOT170 at https://notes.masterweb.skhttps://notes.masterweb.sk/linux-man/wsl-run-ssh-after-start#comments patching (composer.json) https://notes.masterweb.sk/drupal-8/patching-composerjson <span class="field field--name-title field--type-string field--label-hidden">patching (composer.json)</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">ROOT</span></span> <span class="field field--name-created field--type-created field--label-hidden">St, 01/20/2021 - 22:18</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p><a href="https://groups.drupal.org/node/518975">https://groups.drupal.org/node/518975</a></p> <p>composer require cweagans/composer-patches</p> <pre>      "extra": {     "enable-patching": true,         "patches": {             "drupal/core": {                 "payment and video field error": "https://www.drupal.org/files/issues/2020-01-08/3105211-1.patch"             },             "drupal/plugin": {                 "payment and video field error": "https://www.drupal.org/files/issues/2020-01-08/3105214-1.patch"             }         }   } </pre> <p>be aware of brackets and "," after bracket</p> <p>composer install<br /> composer update --lock</p> <p>(implemented succesfully on sophia web)</p> </div><div class="field field--name-field-tags field--type-entity-reference field--label-above clearfix"> <h3 class="field__label">Značky</h3> <ul class="links field__items"> <li><a href="/taxonomy/term/67" hreflang="sk">patch</a></li> <li><a href="/taxonomy/term/68" hreflang="sk">patching</a></li> <li><a href="/taxonomy/term/4" hreflang="sk">composer</a></li> </ul> </div> Wed, 20 Jan 2021 21:18:31 +0000ROOT147 at https://notes.masterweb.sk D7 .htaccess fix https://notes.masterweb.sk/composer-drush/d7-htaccess-fix <span class="field field--name-title field--type-string field--label-hidden">D7 .htaccess fix</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">ROOT</span></span> <span class="field field--name-created field--type-created field--label-hidden">Št, 05/09/2019 - 11:02</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><pre> #Options +FollowSymlinks Options +SymLinksIfOwnerMatch RewriteRule "/\.|^\.(?!well-known/)" - [F] ## this line should be just in www_root .htaccess. In sites/default/files must be NOT. If yes, there will be problems with generating files.</pre> <p> </p> </div><div class="field field--name-field-tags field--type-entity-reference field--label-above clearfix"> <h3 class="field__label">Značky</h3> <ul class="links field__items"> <li><a href="/taxonomy/term/29" hreflang="sk">.htaccess</a></li> </ul> </div> Thu, 09 May 2019 09:02:38 +0000ROOT60 at https://notes.masterweb.sk update D8 8.6.3 -> 8.6.13 https://notes.masterweb.sk/composer-drush-composer-update-prohibits-core-modules-till-d8611/update-d8-863-8613 <span class="field field--name-title field--type-string field--label-hidden">update D8 8.6.3 -&gt; 8.6.13</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">ROOT</span></span> <span class="field field--name-created field--type-created field--label-hidden">So, 03/23/2019 - 15:49</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Updating such old Drupal can be stressing. (one passed, but its not rule - try on sandbox/on your own risk)</p> <p>At first - update drush to version 9.5.x - composer update drush/drush --with-dependencies --dry-run</p> <p>Run drush updb &amp;&amp; drush cr &amp;&amp; drush cron</p> <p>composer outdated drupal/*</p> <p>composer update drupal/core webflo/drupal-core-require-dev --with-dependencies --dry-run</p> <p>composer update drupal/core webflo/drupal-core-require-dev --with-dependencies</p> <p>Run drush updb &amp;&amp; drush cr &amp;&amp; drush cron</p> <p>Tested on PHP v. 7.0.x which failed. After restarting Apache, tried to switch to PHP 7.2.x and voila - PASSED</p> <p>Then I ran composer update - for updating rest of modules (bit risky..), but again - PASSED.</p> <p> </p> </div><div class="field field--name-field-tags field--type-entity-reference field--label-above clearfix"> <h3 class="field__label">Značky</h3> <ul class="links field__items"> <li><a href="/taxonomy/term/19" hreflang="sk">updating old drupal 8 via composer</a></li> <li><a href="/taxonomy/term/4" hreflang="sk">composer</a></li> </ul> </div> Sat, 23 Mar 2019 14:49:15 +0000ROOT17 at https://notes.masterweb.sk Composerize Drupal https://notes.masterweb.sk/composer-drush/composerize-drupal <span class="field field--name-title field--type-string field--label-hidden">Composerize Drupal</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">ROOT</span></span> <span class="field field--name-created field--type-created field--label-hidden">Št, 03/21/2019 - 19:03</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>- update core and modules manually</p> <p>- backup db &amp; files</p> <p>- create subdomain + copy there database</p> <p>- on subdomain create new composer-drupal8 project</p> <p>- install there all modules with exactly versions as on source web (via composer) (if some cant be installed copy them from source to modules/contrib/</p> <p>- install drush</p> <p>- copy missing modules from source, copy settings.php, copy sites/default/files, copy libraries (in webroot)</p> <p>- change db_connect in settings.php</p> <p>- try site - probably error -&gt; run:</p> <p>- drush updb, drush cr, drush cron</p> <p>- try site again - should working</p> <p> </p> <p>history (except copy/move in mc):<br />    70  composer create-project drupal-composer/drupal-project:8.x-dev project_dir --stability dev --no-interaction<br /> cd project_dir (next commands must ran into that directory)<br />    71  composer outdated<br />    72  composer require 'drupal/admin_toolbar:^1.26'<br />    73  composer require 'drupal/backup_migrate:^4.0'<br />    74  composer require 'drupal/coffee:^1.0'<br />    75  composer require 'drupal/google_analytics:^2.4'<br />    76  composer require 'drupal/gtranslate:^1.13'<br />    82  composer require 'drupal/metatag:^1.8'<br />    83  composer require 'drupal/yoast_seo:^1.5'<br />    84  composer require 'drupal/twig_field_value:^1.2'<br />    85  composer require 'drupal/twig_tweak:^2.1'<br />    86  composer require 'drupal/webform:^5.1'<br />    87  composer require 'drupal/weight:^3.1'<br />    88  composer require drush/drush<br />    92  drush<br /> now change webroot to public_html/web &amp; move files there<br /> ! move files and settings.php to new web<br />    93  drush updb<br />    94  drush cr<br />    95  drush cron<br />    96  composer outdated drupal/*</p> <p> </p> <p> </p> </div><div class="field field--name-field-tags field--type-entity-reference field--label-above clearfix"> <h3 class="field__label">Značky</h3> <ul class="links field__items"> <li><a href="/taxonomy/term/18" hreflang="sk">composerizing drupal</a></li> </ul> </div> Thu, 21 Mar 2019 18:03:24 +0000ROOT16 at https://notes.masterweb.sk