Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move Magento Installation to new server

I've been trying now for a few hours to move our Magento installation from dev to live. I found multiple links on the web saying that to move a Magento Installation you need to edit /app/etc/local.xml and update it with the new MySQL credentials and then delete the contents of /var/cache/ (a few even suggested deleting the whole /var folder. I also deleted the contents of /var/session/. Our server is NOT cached (no memcached, varnish, etc). I even restarted apache to see if I could flush any cache that might be running.

So the problem is our Magento installation is still attempting to connect to the old database somehow. We are given this error:

SQLSTATE[28000] [1045] Access denied for user 'oldDBUsername'@'localhost' (using password: YES)

If anyone has any ideas on how to fix this that I haven't already mentioned it would be greatly appreciated.

EDIT:

Here is the stack trace that Magento also reports:

Trace:
#0 fileroot/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 fileroot/lib/Varien/Db/Adapter/Pdo/Mysql.php(300): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 fileroot/lib/Zend/Db/Adapter/Abstract.php(459): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 fileroot/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 fileroot/lib/Varien/Db/Adapter/Pdo/Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 fileroot/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 fileroot/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 fileroot/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_read')
#8 fileroot/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getConnection('read')
#9 fileroot/app/code/core/Mage/Core/Model/Resource/Cache.php(53): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#10 fileroot/app/code/core/Mage/Core/Model/Cache.php(449): Mage_Core_Model_Resource_Cache->getAllOptions()
#11 fileroot/app/code/core/Mage/Core/Model/Cache.php(491): Mage_Core_Model_Cache->_initOptions()
#12 fileroot/app/code/core/Mage/Core/Model/App.php(1175): Mage_Core_Model_Cache->canUse('config')
#13 fileroot/app/code/core/Mage/Core/Model/Config.php(414): Mage_Core_Model_App->useCache('config')
#14 fileroot/app/code/core/Mage/Core/Model/Config.php(294): Mage_Core_Model_Config->_canUseCacheForInit()
#15 fileroot/app/code/core/Mage/Core/Model/App.php(408): Mage_Core_Model_Config->loadModulesCache()
#16 fileroot/app/code/core/Mage/Core/Model/App.php(338): Mage_Core_Model_App->_initModules()
#17 fileroot/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#18 fileroot/index.php(80): Mage::run('', 'store')
#19 {main}
like image 343
Peter Avatar asked Dec 06 '25 19:12

Peter


1 Answers

I figured it out.

When I brought over the dev installation to live I had copied local.xml to local_bk.xml I discovered that Magento will attempt to autoload ALL xml files in the /app/etc/ folder so it was trying to load my backed up file, soon as I renamed my backup to something that didn't end in .xml it worked.

like image 80
Peter Avatar answered Dec 08 '25 09:12

Peter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!