Move Magento Installation to new server
Solution 1
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.
Solution 2
When you install magento you have to select whether cache and session data is stored on the file system or db.
It may be the following line in local.xml, cant quite remember right now.
<session_save><![CDATA[files]]></session_save>
if you are using the db then it stores data in the core_cache table maybe in the database.
See if your db cache tables are empty if they are not truncate them.
You will also need to update your base url both secure and unsecure in core_config_data
see the following for SQL to do the update
Peter
Updated on June 05, 2022Comments
-
Peter almost 2 years
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}