Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 4
PEAR Upgrade problem: How to change the document root location? 
 
Jon Edwards
Jr. Member
 
Total Posts:  29
Joined:  2008-10-10
 

Yeah, I think you’ve got it. I didn’t check your counting for each path (checked a couple and they looked correct) I’d give it a try.

 
Magento Community Magento Community
Magento Community
Magento Community
 
benfrain.com
Sr. Member
 
Total Posts:  142
Joined:  2008-08-15
 

Yes, tried it with this but still the same error:

Fatal error: Call to undefined method PEAR_Error::set() in /home/12345678/domains/12345678.com/public_html/downloader/Maged/Pear.php on line 105

Wondering if I’ll just have to opt for a complete overwrite of the Magento files/folders via FTP - very frustrating…

Any further thoughts?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jon Edwards
Jr. Member
 
Total Posts:  29
Joined:  2008-10-10
 

not sure what to tell ya. If the original pear.ini gets through the install properly, then it has to be a typo or an incorrect path in the new pear.ini. I don’t remember if your error is exactly what I got when my upgrade failed. Are you editing the pear file with a basic text editor like notepad so no extra formatting is added? Are you editing the file locally and then ftp-ing to the server? Check what your transfer type is. I think you either want binary or auto. As a test, first make a backup of the original pear.ini on the server. Then download via ftp as you’ve been doing. Open in the text editor you’re using. Save it. Upload it. And try to run. If this works then your error must be a typo in your pear.ini and not something with the way you’re saving/editing/ftping.  If this is the case, again start with your original pear.ini that works, do a find/replace for the first part of the path with your correct new location path. make sense? Replace ‘/what/ever/your/origininal/pear.ini/path/is/pearlib/’ with ‘/home/12345678/domains/12345678.com/public_html/downloader/pearlib/’ Then count the difference in characters between these two paths. Whatever that difference is, you add or subtract that to each occurance of s:value (easier that character counting and probably less prone to errors) Make sure that you don’t change the s:values for the short paths - like s:9:"cache_ttl" at the very end. 

That’s all I can tell ya. Since you have a working pear.ini, it has to be something with your new pear.ini or the way you’re saving, editing, or transferring the file. Process of elimination. If this doesn’t work, you might be ahead to just start from scratch with a new install. Save you skin and app directories of course.

Hope this helps. Good luck,

Jon

 
Magento Community Magento Community
Magento Community
Magento Community
 
benfrain.com
Sr. Member
 
Total Posts:  142
Joined:  2008-08-15
 

Hi Jon, OK, thanks for that. Tied up today but will give it another shot tomorrow before uploading from scratch.

 
Magento Community Magento Community
Magento Community
Magento Community
 
benfrain.com
Sr. Member
 
Total Posts:  142
Joined:  2008-08-15
 

Right, finally got the new pear.ini working (I’d miscounted one of the ‘S’ numbers - DOH!) but unfortunately I’m still getting the upgrade telling me all is 1.2.0.2 etc but I still see 1.1.7 in my admin interface. May have to bite the bullet and do a fresh install…

 
Magento Community Magento Community
Magento Community
Magento Community
 
seudo
Guru
 
Avatar
Total Posts:  344
Joined:  2008-04-21
 

@arecuk - thanks for the post. “./pear mage-setup” appears to have worked resetting the pear.ini file without manually editing the file.

EDIT: Looks like just running ./pear mage-setup without editing the pear files modifies the original site the files where copied from and not the destination site. I am currently running some tests and will post what I find.

 
Magento Community Magento Community
Magento Community
Magento Community
 
seudo
Guru
 
Avatar
Total Posts:  344
Joined:  2008-04-21
 

Ok, from what I found it looks like you have to edit pear.ini before you run ./pear mage-setup. If not it will effect the original site files.

I also edited the files here magento/downloader/pearlib/
pear
peardev
pecl
as they had references to the original site file structure. I am not sure what benefit / detriment this may have.

 
Magento Community Magento Community
Magento Community
Magento Community
 
diglin
Sr. Member
 
Avatar
Total Posts:  93
Joined:  2008-12-29
Zurich - Switzerland
 

Remove the content - useless anymore

 
Magento Community Magento Community
Magento Community
Magento Community
 
diglin
Sr. Member
 
Avatar
Total Posts:  93
Joined:  2008-12-29
Zurich - Switzerland
 

The pear files are serialized, so need to unserialize, replace the content with the new path of your installation.
Like that you can use this script to change an installed Module via pear. The cache (file.reg) is in this folder : /pearlib/php/.registry/.channel.connect.magentocommerce.com_community (for example)

<?php

$seri = 'Your pear.ini string exple: a:25{..}';
$stringToFind = '/Your old path/';
$stringToReplace = '/Your new path/';

$array = unserialize($seri);

$result = toreplace($array);

echo 'Text to copy in your pear.ini<br/>';
echo serialize ( $result );

function toreplace($array){
global $stringToFind,$stringToReplace;

foreach($array as $key => $value){

if(is_array($value)){
$array[$key] = toreplace($value);
}else{
unset($array[$key]);
$key = str_ireplace($stringToFind, $stringToReplace, $key);
$array[$key] = str_ireplace($stringToFind, $stringToReplace, $value);
}
}

return $array;
}

?>

 
Magento Community Magento Community
Magento Community
Magento Community
 
diglin
Sr. Member
 
Avatar
Total Posts:  93
Joined:  2008-12-29
Zurich - Switzerland
 

In attachment a PHP-CLI script to do scan the entire folder desired to fix the path of every module installed with pear.

You have to provide in arguments:
1) the complete path of the ‘.registry’ folder
2) The text to find (normally the path of your previous installation)
3) The text to replace (normally the path of your new installation)

Exemple:

php -f un/serialize-pear-reg-files.php ‘/the_path_to_magento_installation/downloader/pearlib/php/.registry’ ‘/old_path/shop’ ‘/new_path/shop’

The results are stored in the different sub-folders inside a folder ‘new_serialized’. The files and folders in the .registry are hidden.

I don’t provide support. I don’t have time sorry. But you are free to modify it.

[EDIT]: update the file to provide more info to use it

File Attachments
unserialize-pear-reg-files.php  (File Size: 3KB - Downloads: 627)
 
Magento Community Magento Community
Magento Community
Magento Community
 
loeffel
Guru
 
Avatar
Total Posts:  427
Joined:  2009-02-03
 

Thanks diglin, that did the trick!

 
Magento Community Magento Community
Magento Community
Magento Community
 
kramusica
Member
 
Total Posts:  55
Joined:  2008-07-16
 

I don’t understand how diglin’s file can be processed. Do you modify the php file? Use SSH?

 
Magento Community Magento Community
Magento Community
Magento Community
 
diglin
Sr. Member
 
Avatar
Total Posts:  93
Joined:  2008-12-29
Zurich - Switzerland
 

You can use it as PHP cli (command line) or php script. Take a look in the script I updated it to add comments

 
Magento Community Magento Community
Magento Community
Magento Community
 
kramusica
Member
 
Total Posts:  55
Joined:  2008-07-16
 

I suppose with ‘uncomment’ you mean removing the /* at the end:

 
Magento Community Magento Community
Magento Community
Magento Community
 
diglin
Sr. Member
 
Avatar
Total Posts:  93
Joined:  2008-12-29
Zurich - Switzerland
 

Yes. I’m going to fix again the comment /* is missing.

[EDIT] : done

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 4