Call to a member function setAttribute() on a non-object after magento migration

Before trying anything, clear the cache. That might not help, but do it anyway.

The error is cause by this:

$this->_frontend = Mage::getModel($this->getFrontendModel())
            ->setAttribute($this);

this means Mage::getModel($this->getFrontendModel()) returns null (or false).
This can be caused by an attribute that has the field frontend_model set to something like [module]/something_here but the class [Namespace]_[Module]_Model_Something_Here does not exist.
You can identify the attribute by adding the following code above the line I mentioned:

$model = Mage::getModel($this->getFrontendModel());
if (!$model) {
    echo $this->getAttributeCode();exit;
}

You should see the attribute code in your page.
Then look in the eav_attribute table for this attribute and see if something is wrong with it. If you think the attribute is not needed anymore just delete it.


( ! ) Fatal error: Call to a member function setAttribute() on boolean in E:\wamp64\www\magento19_sampledata\app\code\core\Mage\Eav\Model\Entity\Attribute\Abstract.php on line 366

in my case,

it was due to, disabled local modules by <disable_local_modules>false</disable_local_modules>

after enabling the local modules, it works fine.