Fix enc migration

unfortunately the migration from the old encryption to the new one was broken. This patch fixes it.

cc @FlorinPeter