Errors Encountered During OTRS to Zammad Migration

Infos:

  • Used Zammad version: 6.1.0
  • Used Zammad installation type: docker-compose
  • Operating system: Windows into docker
  • Browser + version: Google Chrome

Expected behavior:

  • Successful migration from OTRS version 6.0.24 to Zammad version 6.1.0 following the official migration documentation, without any errors during the process either via web interface or console.

Actual behavior:

  • Encountering an error while trying to migrate from OTRS to Zammad through the web interface. The error message received on every request made to the OTRS import API is as follows:
{
    "message": "undefined method `first' for #<Ticket:: id: 5, name: \"closed\", note: nil, updated_by_id: 1, created_by_id: 1, created_at: \"2023-10-18 18:44:13.259000000 +0000\", updated_at: \"2023-10-18 18:44:13.259000000 +0000\">",
    "result": "error"
}
  • Additionally, when attempting to set the import endpoint via the console, the following error is encountered:
irb(main):001:0> Setting.set('import_otrs_endpoint', 'https://xxx/otrs/public.pl?Action=ZammadMigrator')
/opt/zammad/app/models/setting.rb:38:in `set': Can't find config setting 'import_otrs_endpoint' (RuntimeError)
irb(main):002:0>

Steps to reproduce the behavior:

  • Install Zammad version 6.1.0 using docker-compose on a Windows machine running Docker.
  • Follow the official Zammad documentation for migrating from OTRS to Zammad.
  • Attempt the migration through the Zammad web interface, observe the error on every request to the OTRS import API.
  • Attempt to set the import endpoint via the console using the command provided in the official documentation, observe the error regarding the inability to find the config setting ā€˜import_otrs_endpointā€™.

Do you have some information from the production.log?

The log does not show much, where I see that error in the Zammad interface during the migration. When making requests

root@d2a9059ea050:/opt/zammad# tail -f log/production.log -n 500
I, [2023-09-13T05:31:37.417029#4021-6320] INFO ā€“ : Using Zammadā€™s file store as Rails cache store.
I, [2023-09-13T05:31:37.417319#4021-6320] INFO ā€“ : Using the File back end for Zammadā€™s web socket session store.

Okay, then some simple question.

At which place are you receiving this mentioned error message (ā€œundefined method ā€¦ā€).

About the ā€œSetting.setā€, did you use the correct docker container for executing this?

I didnā€™t see any problems with the OTRS-Migrator in the last weeks, but I will try it also shorty locally later.

Thank you seriously.
The error is in two places.

  1. Migration attempt from console:
    docker exec -it -u root zammad-docker-compose-zammad-railsserver-1 /bin/bash

rails c

Setting.set(ā€˜import_otrs_endpointā€™, ā€˜https://xxx.tickets.com/otrs/public.pl?Action=ZammadMigratorā€™)
/opt/zammad/app/models/setting.rb:38:in `setā€™: Canā€™t find config setting ā€˜import_otrs_endpointā€™ (RuntimeError)

  1. Migration attempt from the interface
    GET http://localhost:8080/api/v1/import/otrs/import_status?_=1698070084701
    Response:
    {
    ā€œmessageā€: ā€œundefined method `firstā€™ for #\u003cTicket::StateType id: 5, name: "closed", note: nil, updated_by_id: 1, created_by_id: 1, created_at: "2023-10-23 14:03:10.925000000 +0000", updated_at: "2023-10-23 14:03:10.925000000 +0000"\u003eā€,
    ā€œresultā€: ā€œerrorā€
    }

And I know that it continues, because many requests arrive to the API but all with the same error, until after 14 hours, it stops working

I think I found the root cause. Can you maybe share your states from the OTRS side?

This should be fixed in the develop + stable version.

Sure ::))
Here my states into OTRS

These are the states, and there is at least one in a Closed state.
I was reviewing what you posted on GitHub but sorry, I donā€™t know exactly what I should do?

Or where can I find that developer version of zammad to do the migration. Itā€™s just that I want to keep zammad in production and now Iā€™m doing these tests to finally do it in a productive environment

Thanks this list is confirming the problem.

I think you could also update your current docker installation because the fix is also available on stable.

Excellent!, but now how do I do that because Iā€™m trying to search for the stable version 6.2.x but it doesnā€™t appear.

What Iā€™m trying to do is clone the docker-compose repo and within the .env file make the version change

ELASTICSEARCH_VERSION=8.8.0
IMAGE_REPO=ghcr.io/zammad/zammad
MEMCACHE_SERVERS=zammad-memcached:11211
MEMCACHE_VERSION=1.6.20-alpine
POSTGRES_DB=zammad_production
POSTGRES_PASS=zammad
POSTGRES_USER=zammad
POSTGRES_HOST=zammad-postgresql
POSTGRES_PORT=5432
POSTGRES_VERSION=15.3-alpine
REDIS_URL=redis://zammad-redis:6379
REDIS_VERSION=7.0.5-alpine
RESTART=always
VERSION=6.1.0 to 6.2.x?

Or should I do the installation another way?

The current stable version is 6.1.x, the current docker build is always reflecting to stable.

1 Like

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