He eliminado accidentalmente un campo de usuario personalizado. ¿Significa eso que está completamente eliminado de la base de datos o sigue ahí?
Si sigue ahí, ¿hay alguna manera de recuperarlo (aparte de restaurar una copia de seguridad)? ¿O acceder a su contenido mediante el explorador de datos?
Just a thought, but surely there would be a way to recreate the Custom Field and hack together a script to retrieve and refill the data from within a backup using a temporary cloud server to write out the data from the original Custom Field?
Thanks for your thoughts. Yes, that’s obviously what backups are for. I don’t know what the smartest procedure would be for restoring user field content for, say, thousands of users. For me, the number the easiest procedure was to just do it manually. And that was actually surprisingly easy, so I mention it here (from memory, so I may have missed some detail):
When you download the backup file and open it for example with good old WinRAR, you’ll find another archive in there, so open that with WinRAR too. You’ll find an .sql file.
And now comes the good part: you can just open it as a text file (with the built-in WinRAR viewer or otherwise).
Search for the name of the field or some content you hapoen to know and you’ll find the table for that user field.
Now the only trickyness is that (at least in my case) the user ID is not the first but the second value in each row (I’d be curious what the first value represents (“COPY”)).
Actualmente, al eliminar un campo personalizado (las tablas user_fields y user_fields_options si su field_type es dropdown), no se eliminan los valores reales de los usuarios (tabla user_custom_fields). Por lo tanto, una solución rápida (pero potencialmente peligrosa: haz una copia de seguridad primero) es:
Crear manualmente un nuevo campo personalizado.
Reemplazar el nuevo ID en user_fields con el antiguo (esto requiere acceso de administrador a la base de datos): UPDATE user_fields SET id=1 WHERE id=3; (asumiendo que 3 es el nuevo ID y 1 es el antiguo).
Si el campo era un menú desplegable, también tendrás que hacer algo similar en user_field_options.
Si algunos usuarios se registraron en tu sitio y completaron el nuevo campo antes de que lo corrigieras (o si algún usuario existente completó el nuevo campo), también tendrás que corregir esos datos.