Importing your products using a custom script which provisions Magmi.

Importing your products

Importing/Updating products through a combination of a custom import script and Magmi is fairly standard practice for magento websites. The easiest way is to

  1. upload your CSV file using FTP/SFTP/SCP.
  2. Upload your Images using FTP/SFTP/SCP.
  3. Execute a command line call to the import script.

Below are the reference details that you will need before beginning: 

Reference:
<username>: your username
<server>: your backend server
<serverkey>: your computers private key which corresponds to the public key on the server

<sourcefile>: the path on your computer to the source file
<destinationfile> : the path on the server to the destination file
<pathtocustomimportscript> : the path on the server to the custom import script


Uploading your CSV (scp = Secure copy option)

Command to execute:

scp -i ~/.ssh/<serverkey>  <sourcefile> <username>@<server>:/<destinationfile>

Example:
scp -i ~/.ssh/marcserverprivatekey  ~/documents/ecomsite_products.csv marc@backend.myserver.com:~/www/var/import/ecomsite_products.csv

The output will be shown in your terminal.


Uploading your product images (scp = Secure copy option)

Command to execute:
scp -i ~/.ssh/<serverkey>  <sourcefile> <username>@<server>:/<destinationfile>

Example:
scp -i ~/.ssh/marcserverprivatekey  /Users/marc/documents/products marc@backend.myserver.com:~/www/media/import/products

The output will be shown in your terminal.

Execute a command line call to the import script.

Command to execute:
ssh -i ~/.ssh/<serverkey> <username>@<server> 'php <pathtocustomimportscript>'

Example:
ssh -i ~/.ssh/marcserverprivatekey  marc@backend.myserver.com 'php ~/update/import_products.php'

The output will be shown in your terminal.
Ping us if you experienced any issue using our deploy script.
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Deploying your code

Deploying your code in a cluster can get complex and a single misstep may take the website down....

GIT best practices for portable code.

-The head of the master branch should always be the code in production.-The head of the...