OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions How to run Import/Export Entity Data from cli

This topic contains 12 replies, has 2 voices, and was last updated by  Adam 2 years, 5 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #29589

    Adam
    Participant

    Hello,

    I would like to run Import/Export Entity Data from the cli, so I can test it. As now my import doesn’t return any data, but should. I can debug it as script is fire by cronjob.

    Cheers

Viewing 12 replies - 1 through 12 (of 12 total)
  • Author
    Replies
  • #29590
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    Hi Adam,
    There is a command to import entities from CLI oro:import:file.
    Also you can run application in dev mode and check the detailed logs in app/logs/dev.log to see whats happening, logs can be helpful when debug is not an option.

    By the way import running not as a cron job but at message consumer, You can run consumer with debug enabled and set a breakpoint at the ImportProcessor for example, but first of all I recommend to check application logs in dev mode and consumer logs with “-vvv”

    #29591

    Adam
    Participant

    Hi Anyt!

    How can I run my specific import via cli? Do I need to put channel or class/method names into the command? Also, how can I check consumer logs? What is the cli command to run it?

    #29592
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    To know what params can be passed to the command just run it with ‘-h’ flag, like oro:import:file -h
    To see consumer logs – just run it with ‘-vvv’ arguments, like oro:message-queue:consume --env=prod -vvv
    Or if you are using supervisord just update configs to write logs to the file to see them and also run it with maximum verbosity using ‘-vvv’ parameter.

    #29593

    Adam
    Participant

    Also, I’m talking about external imports (API) from the channels. Not from csv file (internal).

    #29594

    Adam
    Participant

    I still don’t have an idea how can I debug my channel import (API)? http://localhost:3080/integration/update/1

    Is there any way to do it with xdebug?

    #29595

    Adam
    Participant

    Any idea, please?

    #29596
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    If you are using phpstorm as an IDE, I can prepare the guide

    #29597

    Adam
    Participant

    Yes, I use PHPStorm + xDebuger and I need to debug my import (batch_jobs.yml). Thank you!

    #29598

    Adam
    Participant

    @Anyt Are you able to help me figure out it?

    #29599
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    As import via integration going at the message consumer, you just trigger it from UI and all the operations done at the background, I show you how to set a breakpoint there to see how it’s processed.

    I recorded video, just because instructions goes to complicated and it was faster.

    example of xdebug configuration can be be found here https://gist.github.com/anyt/904c6a1c0402e26355b8753ce040a5fd

    #29600

    Adam
    Participant

    @Anyt. wow xdebug is working now! That’s great! Thank you! It’s really useful video. I had some missed configuration into my xdebug.ini file. Thanks for the help again.

    #29601

    Adam
    Participant

    Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)

The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.

You will be redirected to [title]. Would you like to continue?

Yes No