Reorganize the organization (ldap user import)

  • Used Zammad version: 2.9.x
  • Used Zammad installation source: (source, package, …) Source
  • Operating system: Linux support 4.15.0-46-generic #49-Ubuntu

Hello,
our Zammad installation is about to start. Our last problem now is the assignment of the organization.
the users are imported via the ldap (including address, e-mail, …).

Is it possible to reorganize the organization now? with SQL (PostgreSQL) or RAILs?

Heya,

if possible, always try to avoid fiddling inside your database directly.
The reason for this is, that you’re breaking your search index (by meaning it’s not up to date any more, until you touch the same object within Zammad some time). So that’s not something you want. :slight_smile:

You can update users and e.g. add your organization information via API or Console.
API-Documentation can be found here: https://docs.zammad.org/en/latest/api-intro.html

The following will update the users organization to the company with ID3 (the user has ID 11):

u=User.find(11)
u.organization_id=3
u.save!

For this you need to know user-ids and organization ids which can be find via
u=User.find_by(login: 'loginuser') or u=User.find_by(email: 'mail@domain.tld'). Organization lookup: Organization.find_by(name: 'Firma1')

Hope that helps.

Thanks for your Feedback.
so, i make a file for every 1930 Users …. however, after the first successful test, the CPU is now running at 100% and the service is no longer reachable after the reboot.

Error: no live upstreams while connecting to upstream,

Tomorrow it goes to the backup.

When doing that to about 2000 users, you’ll have at least 2000 background index jobs (proberbly more by each user you update plus organization plus it’s users attached). This is not optimal and is a bug: https://github.com/zammad/zammad/issues/2431

If you’re not able to reach Zammad any more, it might be that Zammad crashed.
If restarting the service does not help, please check the production log, other wise finding the reason will be hard.

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