[SOLVED] Howto delete item by artisan? (clear all DB in ES)

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
ЕвгенияСемихова(ИПСемиховаЕ.А.)
Posts: 70
Joined: 11 Jan 2025, 09:45

[SOLVED] Howto delete item by artisan? (clear all DB in ES)

Post by ЕвгенияСемихова(ИПСемиховаЕ.А.) » 03 Mar 2025, 10:20

I have another small problem: I deleted all the products and it turned out that the products themselves were deleted first, and then unrelated groupings ("select" type) remained. I fixed one of these "lost" bundles by re-uploading related products. But one record remained unconnected.

Image

And I can't change anything - this product was created manually. Please tell me how can I use the command like:

Code: Select all

php artisan aimeos:job "delete/product" <ID>
to delete a specific product?
Last edited by ЕвгенияСемихова(ИПСемиховаЕ.А.) on 03 Mar 2025, 11:52, edited 2 times in total.
Debian 12, PHP 8.3, Server 1 = Aimeos 2024.10.13, Server 2 = ES 8.17.1
life is full of many new and interesting things

User avatar
ЕвгенияСемихова(ИПСемиховаЕ.А.)
Posts: 70
Joined: 11 Jan 2025, 09:45

Re: Howto delete item by artisan?

Post by ЕвгенияСемихова(ИПСемиховаЕ.А.) » 03 Mar 2025, 10:32

I have create new csv file with only this item's ID and set it to default type - now I've delete all items.
But any way, can I use direct command by artisan?

And my second question: I have load and delete total near 150'000 items (for tests). Now I have delete all. For index not bad this first item's test manipulations? Old IDs will rewrite? What about old ID after delete from ElasticSearch? It's free again? Or somewhere stored?
Or it is better to total new reinstall Aimeos and ElasticSearch servers? For clean start?
Last edited by ЕвгенияСемихова(ИПСемиховаЕ.А.) on 03 Mar 2025, 10:33, edited 1 time in total.
Debian 12, PHP 8.3, Server 1 = Aimeos 2024.10.13, Server 2 = ES 8.17.1
life is full of many new and interesting things

User avatar
aimeos
Administrator
Posts: 8616
Joined: 01 Jan 1970, 00:00

Re: Howto delete item by artisan?

Post by aimeos » 03 Mar 2025, 10:33

There's no possibility to delete products from the command line.
Your product is from a different site (the yellow border on the lef shows that) and therefore, you are not able to delete it. Switch to the site were you have created it, and there you can delete it.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
aimeos
Administrator
Posts: 8616
Joined: 01 Jan 1970, 00:00

Re: Howto delete item by artisan?

Post by aimeos » 03 Mar 2025, 10:33

ЕвгенияСемихова(ИПСемиховаЕ.А.) wrote: 03 Mar 2025, 10:32 Or it is better to total new reinstall Aimeos and ElasticSearch servers? For clean start?
Just delete the ES index and run the setup again if you want to remove all (test) products:

Code: Select all

curl -X DELETE <host>:9200/<index>
php artisan aimeos:setup
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
ЕвгенияСемихова(ИПСемиховаЕ.А.)
Posts: 70
Joined: 11 Jan 2025, 09:45

Re: Howto delete item by artisan?

Post by ЕвгенияСемихова(ИПСемиховаЕ.А.) » 03 Mar 2025, 10:34

aimeos wrote: 03 Mar 2025, 10:33 There's no possibility to delete products from the command line.
Your product is from a different site (the yellow border on the lef shows that) and therefore, you are not able to delete it. Switch to the site were you have created it, and there you can delete it.
I know about yellow border - it is good idea, but I try to delete from superadmin. Any way, now all is good. Superadmin can delete any items.
Debian 12, PHP 8.3, Server 1 = Aimeos 2024.10.13, Server 2 = ES 8.17.1
life is full of many new and interesting things

User avatar
ЕвгенияСемихова(ИПСемиховаЕ.А.)
Posts: 70
Joined: 11 Jan 2025, 09:45

Re: Howto delete item by artisan?

Post by ЕвгенияСемихова(ИПСемиховаЕ.А.) » 03 Mar 2025, 11:49

Just delete the ES index and run the setup again if you want to remove all (test) products:
Thanks a lot!!!

To All:
1) Delete item's indexes at ElasticSearch (command send from Aimeos server):

Code: Select all

curl -k --user elastic:PASSWORD -X DELETE http://192.168.0.4:9200/aimeos
2) also delete items stocks (if you store it also in ES):

Code: Select all

curl -k --user elastic:PASSWORD -X DELETE http://192.168.0.4:9200/aimeos_stock
,where "aimeos" and "aimeos_stock" are your indexes names from "shop.php" file of your DB connecting

3) and after that send:

Code: Select all

php artisan aimeos:setup
Simple and beautiful! No needed to reinstall all!
Debian 12, PHP 8.3, Server 1 = Aimeos 2024.10.13, Server 2 = ES 8.17.1
life is full of many new and interesting things

Post Reply