0

So I've been asked by a client for an online store in which he need each night to delete all the products and import again aprox. 80.000 products. Of course I thought about Magento. But as we all know the importing process is a pain in the ass.

The best option is to use MAGMI of course and the import doesn't take long and it also has a nice utility that quickly empties the database and resets the product ID counter. The problem is with the bloody reindex operation.

MAGMI has a plugin called Magento Reindexer which doesn't work in my case. I guess it needs to ensure security configuration enable "shell_exec()" calls from php. I dunno how to do that. To my only choice is to reindex using the browser from the admin. Of course it's not the best solution specially since it times out and it doesn't work.

So I need to give the client two options:

  1. to create a cron job that would use MAGMI's Clear Catalog utility to empty the database and then use MAGMI to import the same CSV file every night. So all the client would have to do is reupload the CSV file in the same location every night.

  2. Give the client the possibility to manually make the import when he wants using MAGMI and of course empty the database using the same Clear Catalog utility from the MAGMI interface.

Either way I have to find a solution for the reindexing problem.

Does anyone have a similar experience or maybe a solution?

Thanks in advance!

  • _I dunno how to do that._ - perhaps it might be an idea to find out. –  Dec 02 '13 at 20:21

1 Answers1

4

You do not need to empty the database with each import. Magmi has the ability to update products on the fly without deleting them first.

If your concern is removing products that are no longer in the CSV, you can use a plugin I wrote and posted on StackOverflow here: https://stackoverflow.com/a/18447266/1332068

The indexer issue has also been asked about and answered on this site as well.
https://stackoverflow.com/a/19384326/1332068

I urge you to search thoroughly before asking questions as there are several solutions already available for Magmi on this site.

Community
  • 1
  • 1
Axel
  • 10,732
  • 2
  • 30
  • 43
  • Thanks for the help! But unfortunately I have to clear the database each time before import. It's something that the client requested. Using the extra utility of Magmi, this is not a problem. – Cristian Dragos Dec 03 '13 at 12:42
  • Maybe your plugin will be useful in some other situation. Thanks for sharing. Editing the abstract.php file and also using /usr/bin/php5-cli instead of php did the trick. But now I have another problem. The hosting company says that it's not safe to let the shell_exec() function enabled. So will I be able to run the Reindexer from Magmi without the shell_exec() function? – Cristian Dragos Dec 03 '13 at 13:38
  • Magmi relies on the shell_exec() function to call the indexing PHP script. A better way would be to adapter the Magmi indexer script into an actual Magmi plugin, which would bypass the need for running a shell command altogether. – Axel Dec 03 '13 at 15:57
  • Isn't already Reindexer a Magmi plugin? And how could this plugin bypass the need for running a shell command? – Cristian Dragos Dec 07 '13 at 12:31
  • And I see that most people use the Reindexer and the On the fly indexer plugins together because the On the Fly plugin does something better than the first one. Ideally it would be nice to have a plugin doing the best of both. My goal is to give my client an option as simple as possible to do 2 things each night (using a GUI or not): 1. Empty the database; 2. Import and reindex the products. If I use a cron job than he is not in control because it will run automatically. And as I understand Magmi GUI is not secure. Is there a way to do that? Or which would be the best solution? – Cristian Dragos Dec 07 '13 at 12:43