local.xml Points to Local Host but Magento Says It’s on Old Server

databaselocal.xml

I recently moved a magento website for a friend. The old local.xml pointed to the old server IP address so I corrected this on the new site to point to localhost. Everything worked fine and seem to be using the DB on the new server as the account on the old server was suspended.

1 day later the old server was taken offline and the database no longer works, seems it was still pointing to the old server. I've cleared the cache, made sure the compiler was turned off and deleted the sessions with no luck.

Here the local.xml to provide any aid

<connection>
                    <host><![CDATA[localhost]]></host>
                    <username><![CDATA[<DB User>]]></username>
                    <password><![CDATA[<password>]]></password>
                    <dbname><![CDATA[<DB Name>]]></dbname>
                    <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
                    <model><![CDATA[mysql4]]></model>
                    <type><![CDATA[pdo_mysql]]></type>
                    <pdoType><![CDATA[]]></pdoType>
                    <active>1</active>
                </connection>

Best Answer

My initial thought would be to make sure you don't have the local.xml configuration data in any other .xml files in the app/etc/ directory. It doesn't have to be called local.xml, Magento will just use the last instance of the config data it finds in any .xml file from that directory.

So for instance if you have have copied local.xml with the old data to oldlocal.xml in this same directory to back it up, because oldlocal.xml comes after local.xml alphabetically it loads last, thus you get the configuration data from oldlocal.xml, not local.xml.

Related Topic