[ZCS FOSS 8.8.10] Deleteting several accounts in parallel

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
wodel
Advanced member
Advanced member
Posts: 52
Joined: Sat Sep 13, 2014 12:24 am

[ZCS FOSS 8.8.10] Deleteting several accounts in parallel

Post by wodel »

Hi,

Can I delete accounts in parallel, for example starting N jobs with parallel to execute a zmprov da?

Is there any risks in doing that, and will I gain time doing that?

I have many accounts to delete and it's is taking to much time.


Regards.
User avatar
pup_seba
Outstanding Member
Outstanding Member
Posts: 687
Joined: Sat Sep 13, 2014 2:43 am
Location: Tarragona - Spain
Contact:

Re: [ZCS FOSS 8.8.10] Deleteting several accounts in parallel

Post by pup_seba »

I once had to delete 2.600 accounts, and I did it one by one...with a script, but one by one. Something like:
for acc in `zmprov -l gaa | grep -iv "admin\|spam\|ham\|virus\|quarent\|galsync"` ; do zmprov echo $acc ; zmprov da $acc ; done

Don't copy/paste this...I just wrote it out of nothing and you would need to test it first. Indeed takes time, but nothing that is so slow that would force you to force your ldap server with many changes at the same time.

Sadly, I don't know if there is risk or not by doing this task in paralell. But if I would have to do it in paralell, I would take care of not "overlapping" account deletion and then just cross fingers :)

Please note that after you remove the accounts, it will take time to actually see the size in disk being release (du -sh /opt/zimbra/store) and you will have to defragment your mariadb databases manually if you need them to shrink (du -sh /opt/zimbra/db/data).

Good luck,
wodel
Advanced member
Advanced member
Posts: 52
Joined: Sat Sep 13, 2014 12:24 am

Re: [ZCS FOSS 8.8.10] Deleteting several accounts in parallel

Post by wodel »

Hi,

Thank you for your help.

My installation is new and empty for the moment, I just created the accounts, we're preparing a migration and we had a problem with the second store.

Unfortunately the data disks were corrupted, and now I have to clean the installation by deleting the store so I started by deleting the users belonging to that store : 5000 account.

I used this command keeping the total number of jobs to one since I wasn't sure about parallel deletion.

cat users_store2.txt | parallel --jobs njobs zmprov da {}

where njobs contains 1

thanks again

Regards.
User avatar
pup_seba
Outstanding Member
Outstanding Member
Posts: 687
Joined: Sat Sep 13, 2014 2:43 am
Location: Tarragona - Spain
Contact:

Re: [ZCS FOSS 8.8.10] Deleteting several accounts in parallel

Post by pup_seba »

Hi,

Let me insist :) give Zextras a try to do the migration. You can perfectly do the migration just by using the trials (30 days). You could buy it later on or just don't buy it. But using Zextras to migrate will help a lot in regards of calendars, contacts, even provisioning of accounts, domain creation, COS, etc.
7224jobe
Outstanding Member
Outstanding Member
Posts: 283
Joined: Sat Sep 13, 2014 1:55 am
ZCS/ZD Version: 8.8.15_FOSS Patch38

Re: [ZCS FOSS 8.8.10] Deleteting several accounts in parallel

Post by 7224jobe »

Hi, a considerably faster way to use zmprov is creating a file with the commands and passing it to a single zmprov command, follow this Zimbra Tech Center article: https://wiki.zimbra.com/wiki/Bulk_Provisioning
It is not parallel execution, but it is faster than calling zmprov in a while loop.

+1 for the suggestion to use Zextras for a Zimbra to Zimbra migration.
wodel
Advanced member
Advanced member
Posts: 52
Joined: Sat Sep 13, 2014 12:24 am

Re: [ZCS FOSS 8.8.10] Deleteting several accounts in parallel

Post by wodel »

Hi, and thank you all for your replies.

Regarding the use of Zextras, we're not migrating from Zimbra to Zimbra, we're migrating from postfix/dovecot, ..etc mail server to Zimbra.
and from what I've read Zextras is intended to be used only if migrating from Zimbra to Zimbra.
thanks again.

Regards.
Post Reply