Delete multiple bulk users & campaigns in vicidial

Any and all non-support discussions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Delete multiple bulk users & campaigns in vicidial

Postby 14sudharsan » Wed Apr 10, 2013 6:11 am

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
unable to find iso version ? |openSUSE 11.1 (x86_64) | Vicidial VERSION: 2.2.1-237 BUILD: 100510-2015 | Asterisk 1.4.21.2-vici | Sangoma Hardware | No Extra Software After Installation | Intel(R) Xeon(R) CPU E5506 @ 2.13GHz | 8 core processor
14sudharsan
 
Posts: 44
Joined: Fri Oct 01, 2010 10:45 am

Re: Delete multiple bulk users & campaigns in vicidial

Postby DomeDan » Wed Apr 10, 2013 8:02 am

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!!)
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Delete multiple bulk users & campaigns in vicidial

Postby williamconley » Wed Apr 10, 2013 8:32 am

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 ... )
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Delete multiple bulk users & campaigns in vicidial

Postby 14sudharsan » Thu Apr 11, 2013 1:09 am

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';
unable to find iso version ? |openSUSE 11.1 (x86_64) | Vicidial VERSION: 2.2.1-237 BUILD: 100510-2015 | Asterisk 1.4.21.2-vici | Sangoma Hardware | No Extra Software After Installation | Intel(R) Xeon(R) CPU E5506 @ 2.13GHz | 8 core processor
14sudharsan
 
Posts: 44
Joined: Fri Oct 01, 2010 10:45 am

Re: Delete multiple bulk users & campaigns in vicidial

Postby DomeDan » Thu Apr 11, 2013 2:27 am

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!)
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Delete multiple bulk users & campaigns in vicidial

Postby 14sudharsan » Thu Apr 11, 2013 2:41 am

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
unable to find iso version ? |openSUSE 11.1 (x86_64) | Vicidial VERSION: 2.2.1-237 BUILD: 100510-2015 | Asterisk 1.4.21.2-vici | Sangoma Hardware | No Extra Software After Installation | Intel(R) Xeon(R) CPU E5506 @ 2.13GHz | 8 core processor
14sudharsan
 
Posts: 44
Joined: Fri Oct 01, 2010 10:45 am


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot] and 67 guests