Allan Brown

November 1, 2009

Magento connect pear upgraded wrong Magento site!

Filed under: Magento — Tags: , , , — Allan Brown @ 3:14 pm

When we started working with Magento, we started with a single site which we could being learning from.  Once we were happy that we would continue on this platform and decided we needed a 2nd development environment to work on we created a copy of our current Magento install, changed the DB connection config, and thought that was that.

Last week when I went to upgrade Magento to the latest version, a strange thing happened.  The upgrade through Magento connect (downloader/index.php?A=pearPackages) worked perfectly, it said all was upgraded, but the files that were changed were changed on the wrong site.  I eventually tracked this down to the Magento Connect, and the fact that it has its own static config files (pear.ini) which saves the local Magento path.  This obviously did not change when the 2nd copy of the site was created, so when we then performed the upgrade on the staging version of the site, the live site was upgraded instead.

To fix this, simply delete pear.ini, and it will be recreated with the correct settings automatically.

Threads which reference this issue are:

http://www.magentocommerce.com/boards/viewthread/17165/
http://www.magentocommerce.com/boards/viewthread/56226/

Bit of an odd one!

2 Comments »

  1. Hi,
    While trying to upgrade, i have managed to thrash my live site. Had to resolve to backups to fix it.

    Doing it again, and trying my best not to break the live site again. the pear downloader seems to cache paths in a lot of files.

    ./pear mage-setup .
    takes care of the pear.ini file but there are a few other places that have the static path. these are mostly in the downloader/pearlib/php folder.
    i tried search and replacing the path. but then the upgrade does not work.

    so finally replaced the downloader folder with a fresh copy downloaded from the magento website. had to then use ./pear install rather than upgrade-all.

    now when i try to load the site, it is trying to recreate the database – which i cant let it do.. i want it to upgrade my existing DB.

    any thoughts?

    Comment by Yashvit — March 29, 2010 @ 3:28 pm

  2. I had issues trying to upgrade to 1.4 also, both with Magento Connect and the upgrade itself. I found there were three PEAR files I had to change to get the upgrade to complete. These were in the pearlib folder you mention above, pear, peardev and pecl. The issue with changing the paths manually in these files are that they contain a charcount in the files so this also needs to be changed.

    Unfortunately I don’t remember how I sorted this, however this thread may be relevant:

    http://www.magentocommerce.com/boards/viewthread/3379/P15/

    Hope it helps.

    Comment by Allan Brown — March 29, 2010 @ 4:47 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Get Adobe Flash playerPlugin by wpburn.com wordpress themes

Powered by WordPress