7

I have downloaded and extracted the MagMi M2 module from https://github.com/macopedia/magmi-m2 but I have no idea how to install it.

I tried copying it into the vendor dir in several locations, ran ./magento setup, but the module is nowhere to be found in my Magento 2 installation.

So, how do I install that module?

5 Answers 5

9

There is not install for magmi just Copy magmi in main folder

/magmi

and just the following your url you will be able to access the magmi

http://installmagentourl/magmi/web/magmi.php and use default user: magmi paswd: magmi

You are good to go..

One thing more

go to magmi/inc/magmi_engine.php replace the one 511 line and replace else code and add you credential

else {
                $host = $this->getProp("DATABASE", "host", "localhost");
                $dbname = $this->getProp("DATABASE", "dbname", "magento");
                $user = $this->getProp("DATABASE", "user",'root');
                $pass = $this->getProp("DATABASE", "password",'root');
                $port = $this->getProp("DATABASE", "port", "3306");
            }
14
  • I get a login (basic http auth) screen, no user/pass combo to be found. I am logged in into my Magento 2 admin backend. Jan 5, 2018 at 12:34
  • @BartFriederichs use default login foruser: magmi paswd: magmi Jan 5, 2018 at 12:39
  • OK, I can login now, but it gives me just PHP errors (engine not given). I fixed one and I get a lot more now (permission denied, sql connection fail). This really doesn't look like the way to use this. Jan 5, 2018 at 12:41
  • 1
    Also, the webserver needs write access to plugins, conf and state. Jan 5, 2018 at 12:58
  • 1
    @NagarajuKasa give permission to folder. Dec 20, 2018 at 9:03
2

The correct way of setting MAGMI is to create the following file:

magmi/conf/magmi.ini

just copy/rename the magmi/conf/magmi.ini.default file where you can get the basic settings

Then open http://installmagentourl/magmi/web/magmi.php and use your Magento admin account to authenticate and start setting profiles and importing products etc.

1
  • Warning: Use of undefined constant SODIUM_CRYPTO_PWHASH_SALTBYTES - assumed 'SODIUM_CRYPTO_PWHASH_SALTBYTES' (this will throw an Error in a future version of PHP) in /var/www/html/test/pub/magmi/inc/magmi_auth.php on line 69 Warning: substr() expects parameter 3 to be int, string given in /var/www/html/test/pub/magmi/inc/magmi_auth.php on line 69 Warning: Use of undefined constant SODIUM_CRYPTO_PWHASH_SALTBYTES - assumed 'SODIUM_CRYPTO_PWHASH_SALTBYTES' (this will throw an Error in a future version of PHP) in /var/www/html/test/pub/magmi/inc/magmi_auth.php on line 71 Any help thanks
    – zus
    Sep 20, 2020 at 15:25
1

if you do this settings:

else {
                $host = $this->getProp("DATABASE", "host", "localhost");
                $dbname = $this->getProp("DATABASE", "dbname", "magento");
                $user = $this->getProp("DATABASE", "user",'root');
                $pass = $this->getProp("DATABASE", "password",'root');
                $port = $this->getProp("DATABASE", "port", "3306");
            }

then in first prompt you have to give your admin username/password instead of magmi/magmi

1

-> Download Magmi Module (Place magmi folder At magetnoRoot or magetnoRoot/pub path of your Magento)

https://github.com/macopedia/magmi-m2

-> Go to path in URL

http://www.HostName.com/magmi/web/magmi.php

UserName: magmi
Password: magmi

Upon installing Magmi and visiting the web panel for the first time, the default username and password are both set to "magmi". Once successfully logged in, configure Magmi with the Magento database credentials (under Configure Global Parameters) and then save the settings. Afterwards, one can simply use their Magento administrative (backend) credentials to login to Magmi.

-> create file at /var/www/html/magentoRoot/magmi/conf/magmi.ini if magmi at magentoRoot

OR

-> create file at /var/www/html/magentoRoot/pub/magmi/conf/magmi.ini if magmi at magentoRoot/pub

magmi.ini

[DATABASE]
dbname="magento database name"
host="magento database host"
port = "3306"
user=database user
resource = "default_setup"
unix_socket =
password="database password"
table_prefix=
[MAGENTO]
basedir="/var/www/html/magentoRoot"
[GLOBAL]
;---- Uncomment the following line to have a custom import report step, defaults to 100
step = "1"
multiselect_sep = ","
dirmask = "755"
filemask = "644"

Add into your module registration.php file

-> If Your magmi folder on magentoRoot/pub then

registration.php

<?php
require_once BP . "/pub/magmi/plugins/inc/magmi_datasource.php";
require_once BP . "/pub/magmi/integration/inc/productimport_datapump.php";

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'VendoreName_ModuleName',
    __DIR__
);

-> If your magmi folder On Magento Root Then

registration.php

<?php
require_once BP . "/magmi/plugins/inc/magmi_datasource.php";
require_once BP . "/magmi/integration/inc/productimport_datapump.php";

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'VendoreName_ModuleName',
    __DIR__
);

Try This Code For Import Product

$productImport = new \Magmi_ProductImport_DataPump('productimport');
$item = "product field array";
$productImport->beginImportSession("default", "create");// Mode: xcreate, create, update
$run = $productImport->ingest($item);
$productImport->endImportSession();
0

You need to add database name, database username and password, as well as set the permission for the database user to use that database

2
  • Hi I am working on Magento 2.2.2 and have the same issue I have tried the suggestion in this post and the link but still issue is there please can anyone offer any help i need this to update store asap
    – jt9489
    May 13, 2020 at 12:21
  • password and login is correct and working - checked please can anyone post here 2 files magmi/conf magmi.ini and magmi/inc magmi_engine.php So I can compare sytax when entering the password and database details Please change the actual pass and details before posting.
    – jt9489
    May 14, 2020 at 13:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.