I am in the process of creating a web site for a dog training club. I am using Bob Ray's wonderful ClassExtender
http://bobsguides.com/classextender-class.html to provide additional fields for members data.
This is working well. However, having entered a lot of data for all the users, I have realised I need an additional field.
Through trial and error (with, fortunately some backups in place!) I think that the only (and correct?) way to do this is as follows...
- Use phpMyAdmin or similar to back up the contents of the 'ext_user_data' table to a .sql file.
- Drop (delete) the 'ext_user_date' table
- Amend the MyExtUserSchema and MyExtraUserFields chunks to include the new fields
- Re run Extend modUser to regenerate the 'ext_user_data' table with required fields and update the User interface
- Use phpMyAdmin or similar to import the user data exported in step one in to the new, empty 'ext_user_data' table. In my case it seemed necessary to comment out the lines in the sql backup file that read ALTER TABLE `ext_user_data` and ADD PRIMARY KEY (`id`);.
This brings in the old data, correctly associated with the user. However, before I am able to add any data into extended fields I seem to have to re run
Extend modUser a second time. I'm not sure if this is correct.
The above
seems to work in the limited test that I have just run. However, it would be really good if someone who knows what they are doing could advise if this is indeed the correct way to go about this, or if I am unwittingly making a right mess of things!