Proficiencies backfill 2019 [ci skip] #32391
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #26362 for more details. Basically just doing the same thing again for this year.
I'm in the process of testing on a clone; will update once I have. In the meantime, double checking for any mistakes around script IDs and start/end dates would be greatly appreciated.
UPDATE:
Successfully ran backfill (see later post for before and after numbers). Documenting the undocumented steps just in case we need this again.
user_proficiencies
script, in the date ranges, you use the boolean fieldalready_recorded
to indicate whether the ranges had missing data or not.already_recorded
.Run each of the sql commands from the .sql files. This will create one temp table in the db for each date range. You can copy and paste into the mysql CLI, but it may be faster to use syntax like this to read the command from the file instead: https://dev.mysql.com/doc/refman/8.0/en/mysql-batch-commands.html
For each temp table, dump it to a local file using
mysqldump
.You need to convert the resulting dump files to csv. Surprisingly there's no official tool for this and even more surprisingly, this script works: https://github.com/jamesmishra/mysqldump-to-csv
Finally, update the hardcoded filepaths (see the
DATA_DIRECTORY
constant) in theuser_proficiencies
script and run the script. Enter "Y" at both prompts.See query in post below for a way to see if it (looks like it) worked. Of course, it's best if you can test + rehearse this all beforehand on a clone + adhoc.
Running the final script took about 3 hours wall clock time for me.