Restoring a deleted field

Hey, everybody.
I have a field with a dropdown list (Dropdown)
I accidentally deleted a field from the dropdown list
Can I restore it via phpmyadmin?

Yes, you can potentially restore a deleted field from a dropdown list in SuiteCRM using phpMyAdmin, but it’s important to proceed with caution as direct database modifications can have unintended consequences. Here’s a general guideline on how you might attempt to do this:

  1. Backup Your Database: Before making any changes, it’s crucial to create a backup of your entire database. This way, you can revert back to the previous state if something goes wrong.
  2. Identify the Dropdown Field: Find out which module the dropdown field belongs to and the name of the field.
  3. Access phpMyAdmin: Log in to your phpMyAdmin panel, select the database associated with your SuiteCRM instance, and navigate to the table named fields_meta_data.
  4. Locate the Deleted Field: Search for the row corresponding to the deleted field. You’ll likely need to look for the name of the field in the fields_meta_data table.
  5. Restore the Field: If you have a backup of your database, you can try copying the values of the deleted field’s row from the backup’s fields_meta_data table to the current table. Ensure that you’re copying the correct values, especially the values related to the field’s name and module.
  6. Rebuild Relationships: After restoring the field, you might need to perform a Quick Repair and Rebuild within SuiteCRM to ensure that the system recognizes the field again.
  7. Test Thoroughly: After the changes, thoroughly test your SuiteCRM instance to make sure that the field is functioning as expected and that no other issues have arisen due to the manual modifications.

Please note that directly modifying the database can be risky and might lead to unexpected issues if not done correctly. It’s recommended to reach out to SuiteCRM support or a technical expert familiar with the CRM system if you’re unsure about the process. Additionally, if you have regular database backups, restoring the entire database from a point prior to the deletion might be a safer option.

Always work in a controlled environment, make backups, and proceed with caution.

Don’t post ChatGPT answers here, please. If people want to use ChatGPT they can go there themselves.

1 Like

Up to step 4 from sohail1’s answer is good. You should be able to find your field in the field_meta_data table. It should still be there but with a 1 for it’s deleted value you can change it to 0 to bring it back.

In the custom folder you’ll find another folder called “History”
From what I can tell this folder stores changes made to your modules etc from studio
You should be able to find any of the custom changes associated with your field and bring them back (will need to clarify)

I don’t even understand the question. What exactly was deleted? I don’t think “field” makes sense there.

It’s probably an item, an entry in the list.

In which case, it won’t be in the database, that information is stored in PHP files.

After reading the question again yes it seems you said ‘field’ when you meant to say ‘item’ or ‘entry’.

Dropdown lists are stored in PHP files,
you may find something in the custom/history folder