I cannot log into after migration
I also had the same problem, and it was related to mod_rewrite. I have enabled the mod_rewrite with the following command and the problem was fixed.

sudo a2enmod rewrite