I have a large database, 2000 records in one table, 60,000 in another
I'm not changing the larger, just the 2,000 records
Changed a numeric field to different name, and the entire site became unresponsive with a 500 Internal error
Could not edit any views, or list the table directory, or use the dashboard
Eventually the hosting company had to change file permissions, and access was restored
I suspect that field is now inconsistent
The directory shows the column under the old name, while the Toolset field is showing as the new name
Could it be the system required an extensive amount of time to change every instance of the field?
I can restore a backup, but I'd like to understand what is happening for future reference, and how field names can be changed under these circumstances. As you can imagine if its a problem for the small table it's going to be impossible for the larger
Hello and thank you for contacting Toolset support.
To better assist you with this, I'll need more details about it.
2000 records in one table
What do you mean by a table? Is it a table from a database perspective? Or are you talking about custom post type?
Changed a numeric field to different name
Do you mean, you changed the slug or the type of the field? Can you share a screenshot that shows what was changed?
The directory shows the column under the old name, while the Toolset field is showing as the new name
Can you please share screenshots? Please take larger screenshots, and include the URL as it will give me more context about them.
Could it be the system required an extensive amount of time to change every instance of the field?
Maybe, depending on server settings(Memory, CPU time, etc.). From a database perspective, 60000 records is not really a large database. Maybe medium size, some people might consider it small.
I would highly suggest restoring the old database and work on a staging site for testing before applying the change on the live server. If you can provide a Duplicator copy of your website, I can give it a try locally. If you would, please use Duplicator filter to exclude the uploads folder, it will reduce the size of the copy considerably.
Your next reply will be private to let you share the Duplicator copy, or credentials to your website safely.
Rather than put you to unnecessary trouble I will try again under more controlled conditions
Just to be sure, can you confirm it is possible to change an existing field in a 2,000 record custom type
I'm making a change so that $(wpcf-range2) will instead be $(wpcf-topole)
I take it this will involve 2,000 records being updated
Thanks
Jamal is on Vacation. This is Minesh here and I'll take care of this ticket. Hope this is OK.
Changing field name is not suggested as the value for custom fields will be added to the postmeta table.
So, if you have custom field myfield with 2000 posts, there will be 2000 entries added to postmeta table with postmeta key wpcf-myfield.
You will require to change all those matching postmeta key from wpcf-myfield to wpcf-mynewfield.
In addition to that, you will also require to change the custom field slug as well. This will require to run the custom database query.
If you are not sure what to do, if you can help me with admin access details and tell me what field slug you want to change and where you are displaying that field then I'm happy to take the further look.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Thanks for your most generous offer to help with the change. Toolset has the best customer support!
I will forgo changing the name at this time. I think it would help users if you could put a note in the document or near where the field name is entered on the form, saying that it's difficult to change the field name once chosen.
I would have been more careful had I known.
Also, I found this description, and code. Would you say this is a good solution? hidden link