LAMP Server - Sugar CE Version 5.0.0b (Build 3150) - recover dropped CASES custom field table from backup
BEFORE I FIDDLE I would like some guidance on best approach to solve this data read problem - will ask for specific info at bottom.
I have a backup of the custom fields table "cases_cstm" PRIOR to these actions (see attached txt of the csv export). I also have a csv file of all the records in the cases file (not attached)
ACTIONS SO FAR - Since the cases_cstm table in MySQL was last backed up
- Added two new (extra) custom fields (location_c and due_date_c) to an existing custom field in cases module using studio (as attached and shown below).
- Updated forms and list view in studio to recognise new custom fields
- Updated all the existing case records (about 150) with values for these fields
- Exited Sugar - no users active
- Opened MySQL data file (using Webmin to Ubuntu server)
- While trying to find a way to make 'due_date_c' an index for sorting accidently "dropped" the table that is created by Sugar for custom field in MySQL (while in mysql environment as above) - oops - clicked wrong button. I gather the only table in question is "cases_cstm".
- I can see all the Case records in MySQL environment but Sugar will not show ANY records in Sugar Cases list view or permit addition of new records - I gather because the custom field vardefs points to the dropped table and cannot recreate it.
- Repair database did not solve the problem - so Sugar MUST need to have that table created before it can repair it - CORRECT?? - which is understandable
The rest of Sugar seems to be working fine - according to our Sales department.
I can see all the references to these fields - for example in studio, in the cases options on the list and entry screens - just cannot read any data (no errors on list) just no records retrieved.
Only adding new records creates error - so one of my staff told me who did what I told them not to "add a new record" @#~!#$#%#!~ - I did not want to try that. At least they got a copy of the error message...
Retrieving record by id cases:e1b9ab2e-cd81-f482-f033-4ecd937af7df found Query Failed:SELECT cases.* , cases_cstm.* FROM cases LEFT JOIN cases_cstm ON cases.id = cases_cstm.id_c WHERE cases.id = 'e1b9ab2e-cd81-f482-f033-4ecd937af7df' AND cases.deleted=0 LIMIT 0,1::MySQL error 1146:
WHAT I NEED TO KNOW
PS - Once we fix this HOW can I make due_date_c an index field for sorting and retrieval???
First Choice - whatever you gurus come up with that can fix this while ideally retaining ALL the data.......
Second Choice - Do I have enough info here and attached to just recreate the dropped table starting with the backup or are there likely to be internal links that Sugar creates in the now dropped Case Custom Fields Table which I cannot recreate easily.
Third Choice - Can I go back a step and just read the data as it was before adding the new fields - by restoring specific Cases files from backups and if so which files - we unfortunately added and updated some case records when we did the custom fields update and I can see them in mySQL so would rather not tread on them if I do not have to.
Attached is my full cache/modules/Cases/Casevardefs.php file and below just the three fields as copied straight from inside it for ease of reading. Also some other files including the recovered cases_cstm
(Note two of the fields are dropdown select fields - the existing model_c and the new location_c fields).
.
.
.
'model_c' =>
array (
'isMultiSelect' => true,
'required' => '0',
'source' => 'custom_fields',
'name' => 'model_c',
'vname' => 'LBL_MODEL',
'type' => 'multienum',
'massupdate' => '0',
'default' => '',
'comments' => '',
'help' => 'Select the Equipment',
'duplicate_merge' => 'disabled',
'duplicate_merge_dom_value' => '0',
'audited' => 0,
'reportable' => 0,
'len' => 100,
'options' => 'Model_list',
'studio' => 'visible',
'display_default' => 'CABFABY2',
'id' => 'Casesmodel_c',
'custom_module' => 'Cases',
),
'location_c' =>
array (
'required' => '1',
'source' => 'custom_fields',
'name' => 'location_c',
'vname' => 'LBL_LOCATION',
'type' => 'enum',
'massupdate' => '1',
'default' => 'Customer',
'comments' => '',
'help' => '',
'duplicate_merge' => 'disabled',
'duplicate_merge_dom_value' => '0',
'audited' => 0,
'reportable' => 0,
'len' => 100,
'options' => 'Location',
'studio' => 'visible',
'id' => 'Caseslocation_c',
'custom_module' => 'Cases',
),
'due_date_c' =>
array (
'required' => '1',
'source' => 'custom_fields',
'name' => 'due_date_c',
'vname' => 'LBL_DUE_DATE',
'type' => 'date',
'massupdate' => '0',
'default' => NULL,
'comments' => '',
'help' => '',
'duplicate_merge' => 'disabled',
'duplicate_merge_dom_value' => '0',
'audited' => 1,
'reportable' => 0,
'id' => 'Casesdue_date_c',
'custom_module' => 'Cases',
'default_value' => NULL,
),


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks