Magento2: Unterschied zwischen den Versionen

Aus Vosp.info
Wechseln zu:Navigation, Suche
(on productive mode)
 
(23 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
 +
[[Magento 2 Entwicklung]]
 +
 +
[[Magento 2.3 BUGS & HotFixes]]
 +
  
 
== install magento 2.1.0 (Git or Composer) ==
 
== install magento 2.1.0 (Git or Composer) ==
 
cd /var/www
 
cd /var/www
=== 1 A) git ===
+
=== 1 A) git (Nur gedacht für Entwickler kein update übers backend )===
 
<source lang=bash>  
 
<source lang=bash>  
 
git clone https://github.com/magento/magento2.git installdir
 
git clone https://github.com/magento/magento2.git installdir
Zeile 14: Zeile 18:
  
 
<source lang=bash>  
 
<source lang=bash>  
 +
#Falls Composer nicht bereitsteht z.B
 +
# mkdir ~/.cache ~/bin
 +
#chmod 770 ~/.cache ~/bin
 +
#~/.bash_profile
 +
#alias composer='/usr/bin/php7.2 ~/bin/composer.phar'
 +
#
 +
# https://getcomposer.org/download/
 +
# wget "https://getcomposer.org/download/1.8.4/composer.phar"
 +
 +
  
 
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.1.0 installdir
 
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.1.0 installdir
  
 
</source>
 
</source>
 +
 +
=== OR C ===
 +
Download Zip
 +
https://github.com/magento/magento2/releases
  
  
Zeile 26: Zeile 44:
  
 
</source>
 
</source>
 
 
  
 
== Migrationsbeispiel 1.9.1.0 nach 2.1.0 ==  
 
== Migrationsbeispiel 1.9.1.0 nach 2.1.0 ==  
 +
cd INSTALLDIR
 
  chown nonadminuser installdir/ -R
 
  chown nonadminuser installdir/ -R
 
  su nonadminuser (and give him write rights)
 
  su nonadminuser (and give him write rights)
  config repositories.data-migration-tool git https://github.com/magento/data-migration-tool
+
  composer config repositories.data-migration-tool git https://github.com/magento/data-migration-tool
 +
bin/magento --version
 +
Login  https://www.magentocommerce.com/magento-connect  => Connect => Secure Keys
 
  composer require magento/data-migration-tool:2.1.0
 
  composer require magento/data-migration-tool:2.1.0
 
  exit
 
  exit
Zeile 83: Zeile 102:
 
=== Install German Locale ===
 
=== Install German Locale ===
  
+
* https://github.com/firegento/firegento-magesetup2
  Computer require splendidinternet/mage2-locale-de-de
+
 
 +
  composer require splendidinternet/mage2-locale-de-de
 
  rm pub/static/frontend/Magento/luma/de_DE/js-translation.json
 
  rm pub/static/frontend/Magento/luma/de_DE/js-translation.json
 
  bin/magento setup:static-content:deploy de_DE  
 
  bin/magento setup:static-content:deploy de_DE  
Zeile 101: Zeile 121:
 
  rm -rf var/page_cache/*
 
  rm -rf var/page_cache/*
 
  bin/magento setup:static-content:deploy de_DE
 
  bin/magento setup:static-content:deploy de_DE
 +
 +
=== Magenerds BasePrice ===
 +
 +
composer require magenerds/baseprice
 +
composer require magenerds/dashboard
 +
bin/magento module:enable --clear-static-content  Magenerds_DashBoard
 +
bin/magento module:enable --clear-static-content  Magenerds_BasePrice
 +
 +
upgrade etc...
 +
 +
  
 
=== Install SMTP Extension ===
 
=== Install SMTP Extension ===
Zeile 116: Zeile 147:
 
mysql Table: design_change remove design
 
mysql Table: design_change remove design
  
 +
 +
== cron ==
 +
 +
* https://www.matthias-zeis.com/archiv/cronjobs-in-magento-2-2-einrichten
 +
 +
<source lang=bash>
 +
* * * * * /usr/bin/php /path/to/src/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /path/to/src/var/log/magento.cron.log
 +
* * * * * /usr/bin/php /path/to/src/update/cron.php >> /path/to/src/var/log/update.cron.log
 +
* * * * * /usr/bin/php /path/to/src/bin/magento setup:cron:run >> /path/to/src/var/log/setup.cron.log
 +
</source>
  
 
== Flush Cache ==
 
== Flush Cache ==
Zeile 122: Zeile 163:
 
  rm -rf var/generation/*
 
  rm -rf var/generation/*
 
  rm -rf var/page_cache/*
 
  rm -rf var/page_cache/*
 +
rm -rf var/view_preprocessed/*
 
  bin/magento cache:flush
 
  bin/magento cache:flush
 
  bin/magento indexer:reindex
 
  bin/magento indexer:reindex
Zeile 136: Zeile 178:
 
  rm -rf var/page_cache/*
 
  rm -rf var/page_cache/*
 
  bin/magento setup:static-content:deploy de_DE
 
  bin/magento setup:static-content:deploy de_DE
 +
 +
 +
== Re generate css  etc ==
 +
rm -rf  var/cache/*
 +
rm -rf var/di/*
 +
rm -rf var/generation/*
 +
rm -rf var/page_cache/*
 +
rm -rf var/composer_home/*
 +
rm -rf var/view_preprocessed/*
 +
rm -rf pub/static/*
 +
php bin/magento setup:static-content:deploy de_DE
  
 
== Alle Bestellungen löschen ==
 
== Alle Bestellungen löschen ==
Zeile 187: Zeile 240:
  
 
SET FOREIGN_KEY_CHECKS = 1;
 
SET FOREIGN_KEY_CHECKS = 1;
 +
</source>
 +
 +
== sonstige ==
 +
 +
# composer require magento/magento-composer-installer
 +
 +
php -f bin/magento module:enable --clear-static-content  Anc_NewModule
 +
php -f bin/magento setup:upgrade
 +
 +
 +
=== enable disable new module ====
 +
==== Enable ====
 +
bin/magento module:enable --clear-static-content  Anc_NewModule
 +
==== Disable ====
 +
bin/magento module:disable --clear-static-content  Anc_NewModule
 +
 +
=== module-pdfgenerator ===
 +
eadesignro/module-pdfgenerator 1.0.19 requires mpdf/mpdf ^7.0 -> no matching package found.
 +
composer require mpdf/mpdf
 +
composer.json
 +
  "require-dev": {
 +
  ...,
 +
  "mpdf/mpdf": "7.0.x-dev"
 +
},
 +
 +
 +
 +
 +
== patch (via composer) ==
 +
 +
 +
 +
<source lang=bash>
 +
patches/composer/image-upload.diff
 +
</source>
 +
<source lang=bash>
 +
diff --git a/view/adminhtml/ui_component/design_config_form.xml b/view/adminhtml/ui_component/design_config_form.xml
 +
index 8d4580f90c7b..bc1f36222dd6 100644
 +
--- a/view/adminhtml/ui_component/design_config_form.xml
 +
+++ b/view/adminhtml/ui_component/design_config_form.xml
 +
@@ -54,7 +54,7 @@
 +
                <collapsible>true</collapsible>
 +
                <label translate="true">HTML Head</label>
 +
            </settings>
 +
-            <field name="head_shortcut_icon" formElement="fileUploader">
 +
+            <field name="head_shortcut_icon" formElement="imageUploader">
 +
                <settings>
 +
                    <notice translate="true">Not all browsers support all these formats!</notice>
 +
                    <label translate="true">Favicon Icon</label>
 +
@@ -151,7 +151,7 @@
 +
                <collapsible>true</collapsible>
 +
                <label translate="true">Header</label>
 +
            </settings>
 +
-            <field name="header_logo_src" formElement="fileUploader">
 +
+            <field name="header_logo_src" formElement="imageUploader">
 +
                <settings>
 +
                    <label translate="true">Logo Image</label>
 +
                    <componentType>imageUploader</componentType>
 +
 +
</source>
 +
 +
 +
 +
 +
<source lang=bash>
 +
composer.json
 +
</source>
 +
<source lang=bash>
 +
...
 +
"extra": {
 +
        "magento-force": "override",
 +
"composer-exit-on-patch-failure": true,
 +
"patches": {
 +
            "magento/module-theme": {
 +
                "MAGETWO-18688: Header logo image upload fix": "patches/composer/image-upload.diff"
 +
            }
 +
        }
 +
    }
 +
</source>
 +
 +
 +
 +
<source lang=bash>
 +
composer -v install
 +
composer update --lock
 
</source>
 
</source>

Aktuelle Version vom 4. März 2019, 21:17 Uhr

Magento 2 Entwicklung

Magento 2.3 BUGS & HotFixes


install magento 2.1.0 (Git or Composer)

cd /var/www

1 A) git (Nur gedacht für Entwickler kein update übers backend )

 
git clone https://github.com/magento/magento2.git installdir
cd installdir
git checkout tags/2.1.0 -b 2.1.0
composer install

OR 1 B) composer

 
#Falls Composer nicht bereitsteht z.B
# mkdir ~/.cache ~/bin
#chmod 770 ~/.cache ~/bin
#~/.bash_profile
#alias composer='/usr/bin/php7.2 ~/bin/composer.phar'
#
# https://getcomposer.org/download/
# wget "https://getcomposer.org/download/1.8.4/composer.phar"



composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.1.0 installdir

OR C

Download Zip

https://github.com/magento/magento2/releases


2) Basic installation

 
 bin/magento  setup:install --base-url=https://test.domain.tld --db-host=localhost --db-name=testname --db-user=root --db-password=xxxx --admin-firstname=testname --admin-lastname=testname --admin-email=test@domain.tld --admin-user=test --admin-password=TESTPWXXX --language=de_DE --currency=EUR --timezone=Europe/Berlin --use-rewrites=1 --backend-frontname=namebackend --cleanup-database

Migrationsbeispiel 1.9.1.0 nach 2.1.0

cd INSTALLDIR
chown nonadminuser installdir/ -R
su nonadminuser (and give him write rights)
composer config repositories.data-migration-tool git https://github.com/magento/data-migration-tool
bin/magento --version
Login  https://www.magentocommerce.com/magento-connect  => Connect => Secure Keys
composer require magento/data-migration-tool:2.1.0
exit
chown www-data:www-data installdir/ -R
vim vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.1.0/config.xml (after copy config.xml.dist => config.xml )
     < source>
        <database host="localhost" name="olddb" user="root" password="passwd"/>
    < /source>
    <destination>
        <database host="localhost" name="newdb" user="root" password="passwd"/>
    </destination>
    <options>
        <map_file>etc/ce-to-ce/1.9.1.0/map.xml</map_file>
        <eav_map_file>etc/ce-to-ce/map-eav.xml</eav_map_file>
vim vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.1.0/map.xml (after copy map.xml.dist => map.xml )
< source>
        <document_rules>
            <ignore>
                <document>newsletter_subscriber_status</document>
            </ignore>
            <ignore>
                <document>checkout_agreement</document>
            </ignore>
vim vendor/magento/data-migration-tool/etc/ce-to-ce/map-eav.xml (after copy map-eav.xml.dist => map-eav.xml )
            <ignore>
                <field>catalog_eav_attribute.is_visible_on_checkout</field>
            </ignore>
        </field_rules>
    < /source>
bin/magento -r migrate:settings  vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.1.0/config.xml
bin/magento -r migrate:data  vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.1.0/config.xml
bin/magento -r migrate:delta vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.1.0/config.xml


Images and Media
cp -prf old/installdir/media/catalog/ new/installdir/pub/media/catalog/
cp -prf old/installdir/media/favicon/ new/installdir/pub/media/favicon
cp -prf old/installdir/media/catalog/category/ new/installdir/pub/media/catalog/category

Install German Locale

composer require splendidinternet/mage2-locale-de-de
rm pub/static/frontend/Magento/luma/de_DE/js-translation.json
bin/magento setup:static-content:deploy de_DE 
link: https://packagist.org/packages/splendidinternet/mage2-locale-de-de
# Falls eigees design nicht übersetzt wird und es fehler gibt
rm -rf  var/cache/*
rm -rf var/di/* 
rm -rf var/generation/*
rm -rf var/page_cache/*
bin/magento setup:upgrade 
bin/magento setup:di:compile
rm -rf  var/cache/*
rm -rf var/di/* 
rm -rf var/generation/*
rm -rf var/page_cache/*
bin/magento setup:static-content:deploy de_DE

Magenerds BasePrice

composer require magenerds/baseprice
composer require magenerds/dashboard
bin/magento module:enable --clear-static-content  Magenerds_DashBoard
bin/magento module:enable --clear-static-content  Magenerds_BasePrice
upgrade etc...


Install SMTP Extension

composer require magepal/magento2-gmailsmtpapp
php -f bin/magento module:enable --clear-static-content MagePal_GmailSmtpApp

rm -rf var/cache/* rm -rf var/di/* rm -rf var/generation/* rm -rf var/page_cache/* bin/magento setup:upgrade bin/magento setup:di:compile


Remove old design Database

mysql Table: design_change remove design


cron

* * * * * /usr/bin/php /path/to/src/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /path/to/src/var/log/magento.cron.log
* * * * * /usr/bin/php /path/to/src/update/cron.php >> /path/to/src/var/log/update.cron.log
* * * * * /usr/bin/php /path/to/src/bin/magento setup:cron:run >> /path/to/src/var/log/setup.cron.log

Flush Cache

rm -rf  var/cache/*
rm -rf var/di/* 
rm -rf var/generation/*
rm -rf var/page_cache/*
rm -rf var/view_preprocessed/*
bin/magento cache:flush
bin/magento indexer:reindex
# bin/magento setup:upgrade 
#bin/magento setup:di:compile

on productive mode

app/etc/env.php
'MAGE_MODE' => 'production',
after clearing cache 
rm -rf  var/cache/*
rm -rf var/di/* 
rm -rf var/generation/*
rm -rf var/page_cache/*
bin/magento setup:static-content:deploy de_DE


Re generate css etc

rm -rf  var/cache/*
rm -rf var/di/* 
rm -rf var/generation/*
rm -rf var/page_cache/*
rm -rf var/composer_home/*
rm -rf var/view_preprocessed/*
rm -rf pub/static/*
php bin/magento setup:static-content:deploy de_DE

Alle Bestellungen löschen

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `gift_message`;
TRUNCATE TABLE `quote`;
TRUNCATE TABLE `quote_address`;
TRUNCATE TABLE `quote_address_item`;
TRUNCATE TABLE `quote_id_mask`;
TRUNCATE TABLE `quote_item`;
TRUNCATE TABLE `quote_item_option`;
TRUNCATE TABLE `quote_payment`;
TRUNCATE TABLE `quote_shipping_rate`;
TRUNCATE TABLE `reporting_orders`;
TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;
TRUNCATE TABLE `sales_creditmemo`;
TRUNCATE TABLE `sales_creditmemo_comment`;
TRUNCATE TABLE `sales_creditmemo_grid`;
TRUNCATE TABLE `sales_creditmemo_item`;
TRUNCATE TABLE `sales_invoice`;
TRUNCATE TABLE `sales_invoiced_aggregated`;
TRUNCATE TABLE `sales_invoiced_aggregated_order`;
TRUNCATE TABLE `sales_invoice_comment`;
TRUNCATE TABLE `sales_invoice_grid`;
TRUNCATE TABLE `sales_invoice_item`;
TRUNCATE TABLE `sales_order`;
TRUNCATE TABLE `sales_order_address`;
TRUNCATE TABLE `sales_order_aggregated_created`;
TRUNCATE TABLE `sales_order_aggregated_updated`;
TRUNCATE TABLE `sales_order_grid`;
TRUNCATE TABLE `sales_order_item`;
TRUNCATE TABLE `sales_order_payment`;
TRUNCATE TABLE `sales_order_status_history`;
TRUNCATE TABLE `sales_order_tax`;
TRUNCATE TABLE `sales_order_tax_item`;
TRUNCATE TABLE `sales_payment_transaction`;
TRUNCATE TABLE `sales_refunded_aggregated`;
TRUNCATE TABLE `sales_refunded_aggregated_order`;
TRUNCATE TABLE `sales_shipment`;
TRUNCATE TABLE `sales_shipment_comment`;
TRUNCATE TABLE `sales_shipment_grid`;
TRUNCATE TABLE `sales_shipment_item`;
TRUNCATE TABLE `sales_shipment_track`;
TRUNCATE TABLE `sales_shipping_aggregated`;
TRUNCATE TABLE `sales_shipping_aggregated_order`;
TRUNCATE TABLE `tax_order_aggregated_created`;
TRUNCATE TABLE `tax_order_aggregated_updated`;

SET FOREIGN_KEY_CHECKS = 1;

sonstige

# composer require magento/magento-composer-installer
php -f bin/magento module:enable --clear-static-content  Anc_NewModule
php -f bin/magento setup:upgrade


enable disable new module =

Enable

bin/magento module:enable --clear-static-content Anc_NewModule

Disable

bin/magento module:disable --clear-static-content Anc_NewModule

module-pdfgenerator

eadesignro/module-pdfgenerator 1.0.19 requires mpdf/mpdf ^7.0 -> no matching package found.

composer require mpdf/mpdf
composer.json
 "require-dev": {
 ...,
 "mpdf/mpdf": "7.0.x-dev"
},



patch (via composer)

patches/composer/image-upload.diff
diff --git a/view/adminhtml/ui_component/design_config_form.xml b/view/adminhtml/ui_component/design_config_form.xml
index 8d4580f90c7b..bc1f36222dd6 100644
--- a/view/adminhtml/ui_component/design_config_form.xml
+++ b/view/adminhtml/ui_component/design_config_form.xml
@@ -54,7 +54,7 @@
                 <collapsible>true</collapsible>
                 <label translate="true">HTML Head</label>
             </settings>
-            <field name="head_shortcut_icon" formElement="fileUploader">
+            <field name="head_shortcut_icon" formElement="imageUploader">
                 <settings>
                     <notice translate="true">Not all browsers support all these formats!</notice>
                     <label translate="true">Favicon Icon</label>
@@ -151,7 +151,7 @@
                 <collapsible>true</collapsible>
                 <label translate="true">Header</label>
             </settings>
-            <field name="header_logo_src" formElement="fileUploader">
+            <field name="header_logo_src" formElement="imageUploader">
                 <settings>
                     <label translate="true">Logo Image</label>
                     <componentType>imageUploader</componentType>



composer.json
...
"extra": {
        "magento-force": "override",
	 "composer-exit-on-patch-failure": true,
	 "patches": {
            "magento/module-theme": {
                "MAGETWO-18688: Header logo image upload fix": "patches/composer/image-upload.diff"
            }
        }
    }


composer -v install
composer update --lock