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?
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.
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')
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,
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.