I'm want to do reindexing in magento 2. We can reindex with terminal command?
Magento 2: reindexing is not working
fire this command from magento root via terminal
to reindex all :
php bin/magento indexer:reindex
OR
reindex perticuler :
php bin/magento indexer:reindex indexer_name
Where indexer_name Should be from followings:
catalog_category_product
catalog_product_category
catalog_product_price
catalog_product_attribute
cataloginventory_stock
catalogrule_rule
catalogrule_product
catalogsearch_fulltext
Get list of available indexing in Magento 2
magento indexer:info
Check indexing status
magento indexer:status
Even you can check individual indexing status using below command
magento indexer:status catalog_category_product
How to reindex all available indexing in Magento 2
magento indexer:reindex
In case you fill memory limit, try this command
php -dmemory_limit=2G magento indexer:reindex
Related
I have researched this problem extensively and I have tried everything that has been suggested, but I think I may have missed something. I have a laravel project with the following configuration for .env:
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=oamileage
DB_USERNAME=postgres
DB_PASSWORD=********
I have also uncommented the following line in php.ini:
;extension=pdo_pgsql -> extension=pdo_pgsql
I get the following error when I try to use php artisan migrate:
Illuminate\Database\QueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = public and table_name = migrations)
A side note: I already have pgsql up and running for another project of mine (which is unrelated to laravel) and it's working without a problem. I am on windows.
I have my PDO drivers installed, as seen here:
It seems that the php cli has another config file installed elsewhere (the path can be found in phpinfo()). I uncommented the following line, according to madflow and it worked:
;extension=pdo_pgsql -> extension=pdo_pgsql
You just need to install:
sudo apt-get install php7.2-pgsql
After the previous command you can migrate your models to database:
php artisan migrate
Magento Version 2.2.7.
I wanted to backup the system and database with the Tools given by Magento2.
But in the backend when I go to System - Backups, I get the message
Backup functionality is disabled
Backup functionality is currently disabled. Please use other means for backups
Where can i enable it?
You can enable Backup setting by going to Stores/Configuration, Advanced=>System, Backup Setting:
If you want to enable it with the CLI, you can use the command:
php bin/magento config:set system/backup/functionality_enabled 1
For the enable Backups to run below command.
php bin/magento config:set system/backup/functionality_enabled 1
Configuration - System - Backup Settings
vas
Magento2 i tried to run some command required for adding new payment gateway
one of them
up grade database : bin/magento setup:upgrade
but i got the below error can anyone help
Running schema recurring...We can't find the role for the user you wanted.
You can open this file
src/app/code/Magento/Authorization/Model/Acl/AclRetriever.php
line 68 and check why AuthorizationException is thrown.
Magento 2.2.4, PHP 7.0.30.
While running setup:upgrade command in SSH, a list of modules appear then I get:
Module 'Magento_SalesSequence':
Running data recurring...Unique constraint violation found
Then the upgrade seems to stop. How do I identify the data causing the unique constraint violation? I have checked some log files in var/logs and some tables containing "sequence" in the database using PHPMyAdmin, but there is probably a better way.
Any help appreciated.
Can run the following command php bin/magento setup:db-data:upgrade
It would be mostly the unique value issue in table "cym_sales_sequence_meta" for the field "sequence_table". You can remove the values or empty the table and run the setup upgrade again. The issue will be sorted.
it seems updating magento is really hard :)
I have magento 1.4.1.1 and i want to update it to the newest magento 1.4.2.
I follow this guide:
How to upgrade magento 1.4 1.1 to 1.7.0.2
What i of course do:
- Disable and clear cache
- Clear sessions
- Disable all extensions before update
- Backup backup backup :D
When i update from 1.4.1.1 to 1.4.2 i trigger the mainpage to make the mysql changes. This is where to problems start.
I get this error:
a:5:{i:0;s:435:"Error in file: "/var/www/vhosts/dev/docs/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.4.0.20-1.4.0.21.php" - SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`dev`.<result 2 when explaining filename '#sql-20eb_3d66'>, CONSTRAINT `FK_PRODUCT_ORDERED_AGGREGATED_MONTHLY_PRODUCT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entit)";i:1;s:974:"#0 /var/www/vhosts/dev/docs/app/code/core/Mage/Core/Model/Resource/Setup.php(390): Mage::exception('Mage_Core', 'Error in file: ...')
I have also tried to upgrade to 1.7 directly which leeds to numerous other similar errors. I of course could comment out all those pieces which cause problems but i dont think that would be wise :)
Do you have any idea what i can do avoid / fix these errors?
Thank you very much :)
Greets
Yes, upgrading Magento is almost never smooth.
To diagnose this particular problem you have to compare types sales_bestsellers_aggregated_monthly.product_id and catalog_product_entity.entity_id fields.
You can find more details on what is causing this problem and also a solution in my article dedicated to this subject.
In English: How 3rd Party Extensions Can Ruin Your Magento Upgrade
Auf Deutsch: Wie Externe Extensions Dein Magento-Upgrade Ruinieren Können
If you had made a backup of your database and it is possible to restart the process, I would advise you to go another way, but here you will have to move to 1.5 than to 1.6 than to 1.7:
First, you have to get SSH access from your hosting provider and connect to your server via SSH protocol.
Then,
1 – Change permissions on lib/pear folder to writable (recursively):
chmod -R 777 lib/PEAR
2 – Execute this command to prepare Magento for upgrade:
./pear mage-setup
Most likely you will see this result after command execution:
Channel “connect.magentocommerce.com/core” is already initialized
Upgrade from Magento 1.4.1.x to Magento 1.4.2.0
This step is necessary even if you upgrade your Magento store to 1.5 or 1.6 versions.
3 – Execute Magento upgrade command:
./pear upgrade -f magento-core/Mage_All_Latest-stable
Output of the command will show you what core packages were upgraded:
upgrade ok: channel://connect.magentocommerce.com/core/Interface_Adminhtml_Default-1.4.2.0
4 – When this part of the upgrade will be complete, enter these commands:
chmod 550 ./mage
./mage mage-setup .
You will see this result after command execution:
Successfully added: connect20.magentocommerce.com/community
It means that Magento connect 2.0 channel was added to the channels list successfully.
5 – Next, enter this command:
./mage sync
Here you should see::
…
Successfully added: community/Mage_Locale_en_US-1.4.2.0
Successfully added: community/Interface_Install_Default-1.4.2.0
Successfully added: community/Phoenix_Moneybookers-1.2.3
Successfully added: community/Mage_Downloader-1.5.0.0
Successfully added: community/Lib_Google_Checkout-1.4.2.0
Upgrade to Magento 1.4.2.0 is complete and now you can proceed with upgrade to Magento 1.5.1.0 or 1.6.0.0.
Before proceeding with this part of Magento upgrade, it is very important to see to what version Magento upgrade scripts will upgrade your store. Enter this command to check this:
./mage list-upgrades
If you will see this result:
Updates for community:
Mage_All_Latest: 1.4.2.1 => 1.6.0.0
Lib_Js_Mage: 1.4.2.0 => 1.6.0.0
Lib_Varien: 1.4.2.0 => 1.6.0.0
Lib_Phpseclib: 1.4.2.0 => 1.5.0.0
It means that your Magento will be upgraded to version 1.6.0.0. If it is not what you need you can change upgrade channel to “stable” and upgrade your Magento to version 1.5.1.0.
6 – Enter this command to change the upgrade channel to stable:
./mage config-set preferred_state stable
After this the “./mage list-upgrades” command will show you this result:
Updates for community:
Mage_All_Latest: 1.4.2.1 => 1.5.1.0.1
Lib_Js_Mage: 1.4.2.0 => 1.5.1.0
Lib_Varien: 1.4.2.0 => 1.5.1.0
Lib_Phpseclib: 1.4.2.0 => 1.5.0.0
Mage_Core_Adminhtml: 1.4.2.0 => 1.5.1.0
Mage_Core_Modules: 1.4.2.0 => 1.5.1.0
7 – After channel selection you can upgrade your Magento to 1.5.1.0 (or to Magento 1.6.0.0) using this command:
./mage upgrade-all –force
You will see upgraded packages on your screen:
…
Package upgraded: community/Mage_Locale_en_US 1.6.0.0
Package upgraded: community/Lib_Mage 1.6.0.0
Package upgraded: community/Lib_ZF 1.11.1.0
Package upgraded: community/Lib_Js_Prototype 1.7.0.0.1
Package upgraded: community/Lib_ZF_Locale 1.11.1.0
Now the upgrade is complete. If everything was upgraded correctly, you will see upgraded store in your browser.
In the admin panel, you can check the version of your store.
If you had made a brand new installation of Magento version, and you won’t do manual data transfer, since it would take days or even weeks. What you can do to move your database directly from 1.4 to the new Magento 1.7 you can use automated service.
I have similiar problem:
app\code\core\Mage\Sales\sql\sales_setup\mysql4-upgrade-1.4.0.20-1.4.0.21.php" - SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails ..
but i my case, error appeared with this key:
FK_PRODUCT_ORDERED_AGGREGATED_DAILY_PRODUCT_ID
The solution was quite easy, I just delete entries from tables:
sales_bestsellers_aggregated_daily
sales_bestsellers_aggregated_monthly
sales_bestsellers_aggregated_yearly
where product_id wasn't correspond with entity_id at catalog_product_entity table.
This query helps you detect useless product_ids:
SELECT product_id FROM sales_bestsellers_aggregated_yearly where product_id not in
(select entity_id from catalog_product_entity)