1

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>
11
  • 2
    are you sure you cleared the cache properly? I mean if you have APC or memcached those need to be cleared also. Also check maybe the cache is not writtern in var/cache folder of Magento. If that's not writeable Magento will use /tmp folder of the system.
    – Marius
    Aug 4, 2014 at 10:14
  • I have SSH access and cleared the cache via rm -rf var/cache/*. I couldn't find a /tmp under the root magento directory.
    – lee murphy
    Aug 4, 2014 at 10:15
  • 2
    Don't look for /tmp in the magento instance. Look for it in the file system. /tmp it's an absolute path, not relative to your install.
    – Marius
    Aug 4, 2014 at 10:17
  • That tmp is empty
    – lee murphy
    Aug 4, 2014 at 10:18
  • If there is no memcache or APC (or any other cache-ing system ) involved, I'm out of ideas.
    – Marius
    Aug 4, 2014 at 10:19

2 Answers 2

2

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.

6
  • We only have one local.xml
    – lee murphy
    Aug 4, 2014 at 10:38
  • Ok, what other .xml files do you have in that directory? Aug 4, 2014 at 10:40
  • config.xml, local.xml, local.xml.additional, local.xml.template
    – lee murphy
    Aug 4, 2014 at 10:42
  • Ok, well seems like some code diving may be the next step! Aug 4, 2014 at 10:51
  • Do you need the local.xml code?
    – lee murphy
    Aug 4, 2014 at 11:00
2

Resolve the issue.

There a plugin on the website has a DB connection file. This file was also pointing to the old server and seems to be overwritting the local.xml

Once this was updated the site was working again.

2
  • Also, if there are any other .xml files in the app/etc/ folder, they will be included in the Magento runtime and can be the source of such issues. Aug 4, 2014 at 17:50
  • Already been suggested - see my answer above. Aug 5, 2014 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.