-
Notifications
You must be signed in to change notification settings - Fork 6
Migrating users from old to new CantusDB
Jiwoo Jeong edited this page Aug 12, 2022
·
5 revisions
Before following the steps below, please ensure that "Setting up user permissions and privileges in the new CantusDB" has been completed already.
- Delete all, if any, users in the Django admin interface.
- Place
id_username_email.csv
(obtained from Junhao) into the same directory asoldcantususer_uid_role.csv
. - Run
python old_users_list.py
. Usingoldcantususer_uid_role.csv
(which has rows of user_uid-role pairs) andid_username_email.csv
(which has rows of user_uid-email pairs (for some indexi
,row[i]
of botholdcantususer_uid_role.csv
andid_username_email.csv
have the same user_uid)), this script will scrape user data from the old CantusDB's user-detail page into a new file calledoldcantususer_uid_role_detailed.csv
. - Run
python manage.py add_all_users
. Usingoldcantususer_uid_role_detailed.csv
(where each row contains data for one user), this command will read the file row-by-row and create a new user with the row-specified data (if they do not already exist), or update them appropriately (if the user already exists). Also, this command will readeditors_source.csv
to assign users to sources that they were previously assigned to in the old CantusDB. After this step, all users should have been successfully migrated. - Run
python manage.py createsuperuser
to create an admin account.