fix migration old encryption -> new encryption

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