Page 1 of 1

Delete multiple bulk users & campaigns in vicidial

PostPosted: Wed Apr 10, 2013 6:11 am
by 14sudharsan
Im using vicibox with Open suse OS

Vicidial VERSION: 2.2.1-237
BUILD: 100510-2015

Asterisk 1.4.21.2-vici currently running on Dialing servers


I wanna delete 250 users & 57 campaigns in a single shot . Can you pls guide me how

One by one deleting it was very big work & dont have that much time

Re: Delete multiple bulk users & campaigns in vicidial

PostPosted: Wed Apr 10, 2013 8:02 am
by DomeDan
I dont know of any bulk delete for users and campaigns, but maybe it exists in the latest version..
but you can use phpmyadmin, find it at: http:// your-vicidial-server-address/phpMyAdmin/
login with your database user/pass if thats not setup then its "root" and no password

start to write a query to find the users in question like this:
SELECT * FROM asterisk.vicidial_users where user_id > 4 and user_id < 300

and then use the update command to "SET active='N'"

be carefull when working in phpmyadmin, you must know exactly what you are doing before executing any command, its easy to mess up everything (do backups too btw!!)

Re: Delete multiple bulk users & campaigns in vicidial

PostPosted: Wed Apr 10, 2013 8:32 am
by williamconley
you can also use phpMyAdmin to view the user records and check the "delete" box next to the ones you want to get rid of. this allows for more control and doesn't take a huge amount of time.

you can also use domedan's suggestion for setting them to inactive instead so you can reactivate any of them later if you want to
Code: Select all
update vicidial_users set active='N' where user > '555' and user < '666';


Beware: user and user_id are not the same field! LOL (deactivating them is safer than deleting them ... )

Re: Delete multiple bulk users & campaigns in vicidial

PostPosted: Thu Apr 11, 2013 1:09 am
by 14sudharsan
Thanks for your reply ..
If i keep inactive it will be always an entry in users page . It seems so clumsy .. My manager want's to delete unwanted campaigns & users


Can you suggest below mentioned mysql commands shall i use or not

#delete campaings
DELETE FROM `asterisk`.`vicidial_campaigns` WHERE `campaign_id`='cmpaign1';
DELETE FROM `asterisk`.`vicidial_campaigns` WHERE `campaign_id`='cmpaign2';

###delete users
DELETE FROM `asterisk`.`vicidial_users` WHERE `user`='username1';
DELETE FROM `asterisk`.`vicidial_users` WHERE `user`='username2';

Re: Delete multiple bulk users & campaigns in vicidial

PostPosted: Thu Apr 11, 2013 2:27 am
by DomeDan
The manager here too wants to delete unwanted campaigns, but you should not take the managers words straight into action.
I created a user groups for managers and just unchecked the campaign in the user groups "Allowed Campaigns"
because the next day they might say "I want that campaign back" (talking from experience in similar situations)

Regarding users, I don't know if your version has the option "show all users" in the user list, but its very nice, just inactivate the user and then it wont be visible until you click on that link.
if you don't have it and want it, then just do a upgrade using svn

The sql querys you wrote will probably work but it might mess things up, everywhere there is a join clause in the code it will fail etc
consider my recommendation with user groups, if you choose the DELETE way then do a backup first (always do backups!)

Re: Delete multiple bulk users & campaigns in vicidial

PostPosted: Thu Apr 11, 2013 2:41 am
by 14sudharsan
Im Damn sure he will never ask users which im going to deleted bcoz those users already left the job .

I have already set as inactive unwant campaings & users

Thanks for ur reply dome dan