How to trace OTRS migration output to logfile?

How can I configure the zammad console to trace/redirect the output to a logfile?

I don’t think that the rails console has an in-built logging feature. The easiest way would therefor probably be to use an external tool like script:

script -a migration.out

This will open a new shell; start the rails console in this shell, and when you’re done, close the rails console and then close the shell too.

You can then replay the recorded migration with the following command:

scriptreplay migration.out

If you don’t want the timing stuff, you can use script without it:

script -a migration.out

Beware though that the output file will contain raw escape sequences e.g. for colors, so it’s best viewed either with cat or less -r.

I am pretty fresh to rails…

can you help me more specifically?

need to execute

zammad run rails c

in this rails console

Delayed::Worker.max_run_time = 7.days
Setting.set('import_otrs_endpoint', '')
Setting.set('import_otrs_endpoint_key', '1234567890sdfghjkl')
Setting.set('import_mode', true)
Setting.set('system_init_done', false)

How to do this?

Excuse me if this is a bit direct but:
Run zammad run rails c on your systems console and then paste the below code into the console, after the promp comes up…?

If this is about your other topic, please don’t mix things too much, this doesn’t help at all. :-x

facepalm :man_facepalming:

I have just executed the script command as noted before. I understood as a script which I have to write. Along with a additional script which contains the script for zammad console.

Thanks for pointing me to my issue between the ears. :slight_smile:

regarding your question not to mix two topics. Did not mix them, just wanted to have a zammad migration script which runs in the zammad console (see above)

=> my issue hopefully solved.
(Logfile is getting written, timing-file also. Will wait for the next failure of the migration.)

1 Like

Okay great, sorry for my confusion on here.
Good luck!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.