Ok I'll help you with this problem. You can do this with non-agent api (update_lead function) or manually with "/vicidial/admin_modify_lead.php?lead_id=xxx" one by one lead. But now let's start with my sql query solution:
1. First backup your system before you start (be careful and go exactly my described way)
2. Add a new list with exactly the same settings as your old broken list (name e.g.: 2019)
3. Copy or create all custom fields to 2019 exactly the same as your old broken list (name: 2018) [very important they must be identical--> RANK,LABEL,NAME,TYPE]
3.1 Recreate the old custom fields in your broken list 2018 if not done already
4. Add one new extra custom field to 2019 with name "old_id"
5. Download the old list "2018" with all fields and fill in with your missing custom fields
6. VERY IMPORTANT PART: create a new column "old_id" in your downloaded and edited file. Copy "lead_id" (this is the original lead_id of your broken list) column data to "old_id" column in your file.
7. Import the edited file into your new list "2019" with Load New Leads (setting: No Duplicate Check!!!)
8. Now you should have a fresh vicidial list "2019" with all the missing custom fields, but NEW status and new lead_ids. Verify that the "old_id" custom field contains the original lead_id of your broken list 2018. This will later be used as identifier
9. BE VERY CAREFUL WITH NEXT STEPS:
For example (change everywhere "2018" with your real broken list_id):
2018 (list_id of your old broken list)
2019 (list_id of your new added list)
Type from linux cli:
- Code: Select all
mysql -D asterisk -e 'DROP TABLE `custom_2018`;'
- Code: Select all
mysql -D asterisk -e 'CREATE TABLE `custom_2018` LIKE `custom_2019`;'
- Code: Select all
mysql -D asterisk -e 'INSERT `custom_2018` SELECT * FROM `custom_2019`;'
- Code: Select all
mysql -D asterisk -e 'UPDATE `custom_2018` SET `lead_id` = `old_id`;'
After this procedure your custom fields will be recovered.
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3