Magento – Moving to a New Server, Database Errors & More

I tar.gz my store’s entire directory. I exported the MySQL database. Then I uploaded the tar.gz file to the new server. Extracted it. Created a new MySQL database. Updated app/etc/local.xml with the new MySQL login information. Then I attempted to load the website. The frontend of the website loaded just fine but when I attempted to login to the admin portion of Magento (yourdomain.com/admin). I got a “404 Error. Page not Found.” message. I checked Magento’s system.log (var/log/) to only find these two errors repeating over and over:

ERR (3): Recoverable Error: Argument 1 passed to Mage_Core_Model_Store::setWebsite() must be an instance of Mage_Core_Model_Website, null given, called in /home/website/public_html/app/code/core/Mage/Core/Model/App.php on line 624 and defined in /home/website/public_html/app/code/core/Mage/Core/Model/Store.php on line 304

 

ERR (3): Recoverable Error: Argument 1 passed to Mage_Core_Model_Store_Group::setWebsite() must be an instance of Mage_Core_Model_Website, null given, called in /home/website/public_html/app/code/core/Mage/Core/Model/App.php on line 644 and defined in /home/website/public_html/app/code/core/Mage/Core/Model/Store/Group.php on line 235

After some research and searching for a solution on the web I came to several posts containing this SQL code to fix the “admin page not loading” problem.

[/crayon]

While this code appears to have worked for most, it did not work for me. After 12+ hours of troubleshooting this problem I was finally able to narrow down the problem. When I was importing my backed up databases I stripped out the part of the SQL code that creates a “new table”, as I already had one created. In the process of doing so, I stripped out 3 different sets of code that proved to be required for the database to migrate over properly into the MySQL database.

SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE=”NO_AUTO_VALUE_ON_ZERO”;

<–MYSQL COD HERE–>

SET FOREIGN_KEY_CHECKS=1;

Be sure to clear your cache in your root /tmp/magento directory and in Magento’s tmp directory (/home/website/public_html/var/cache)

Source: link

Was this blog post helpful for you?

Support my blog and donate!

My blog is open to the public and will always be freely available. With your donation, we can help others learn, together.

Donate in Bitcoin:

13PtvsxGbkbUDAtMzxk1wPeWEECx6jKM8f