diff --git a/helios/migrations/0003_v3_1_election_specific_voters_with_passwords.py b/helios/migrations/0003_v3_1_election_specific_voters_with_passwords.py
index 008c9c6242b69866f1e03eff8e9df4e0a53ac931..cd9c3d384b6b83335d14023e884680031fc43f5d 100644
--- a/helios/migrations/0003_v3_1_election_specific_voters_with_passwords.py
+++ b/helios/migrations/0003_v3_1_election_specific_voters_with_passwords.py
@@ -33,7 +33,7 @@ class Migration(DataMigration):
             v.save()
 
         # also, update tinyhash for all votes
-        for cv in orm.CastVote.objects.all():
+        for cv in orm.CastVote.objects.all().iterator():
             safe_hash = cv.vote_hash
             for c in ['/', '+']:
                 safe_hash = safe_hash.replace(c,'')