Help! Did I lose all my custom registration data just because I customized a field?!

Here’s the background of how I set up a custom registration field for my Open edX instance.

Today I added a missing country to the nationalities list, and ran the following commands that I found on the web:

tutor local run lms bash
./manage.py lms migrate custom_reg_form zero
./manage.py lms makemigrations custom_reg_form
./manage.py lms migrate

And now when I log in to Django, it seems like all the data under “Custom_Reg_Form” has disappeared?! Is there any way for me to recover it?
(Now that this happened and I’m reading them closer, that “migrate custom_reg_form zero” is suspicious :frowning: )

As you suspected, this is indeed what did it. When you migrate a table to version “zero”, it basically removes it from the database. There is no way to restore the data except by using a backup.

Thanks for confirming my suspicion. I went ahead and restored from backup.

What’s the correct way to edit this form without zeroing out the db? Just skipping that step?