Migrate a Magento store without SSH access

We were recently asked to migrate a store to our Sonassi Hosting platform, but the client did not have SSH access to his previous hosting account. So we quickly knocked up a script to take care of the backup process <?php $xml = simplexml_load_file("app/etc/local.xml"); $db_host = (string)$xml->global->resources->default_setup->connection->host; $db_name = (string)$xml->global->resources->default_setup->connection->dbname; $db_username = (string)$xml->global->resources->default_setup->connection->username; $db_password = (string)$xml->global->resources->default_setup->connection->password; $mysqldump = trim(shell_exec("which mysqldump")); $tar = trim(shell_exec("which tar")); // Backup database var_dump(shell_exec("$mysqldump -h $db_host -u $db_username -p$db_password $db_name > migration_db.sql")); // Backup entire site var_dump(shell_exec("$tar cfz migration_www.tgz . –exclude=var/session –exclude=var/cache –exclude=var/report –exclude=var/backups –exclude=var/log –exclude=media –exclude=*.tgz –exclude=*.gz –exclude=*.tar –exclude=*.zip ")); // Grab non-compressible data var_dump(shell_exec("$tar cf migration_misc.tar media *.tgz *.gz *.tar *.zip –exclude=migration_misc.tar")); We carried out the restoration via SSH, but you could also have a PHP script take care of that too: <?php $db_host = ""; $db_name = ""; $db_username = ""; $db_password = ""; $current_domain = ""; $mysql = trim(shell_exec("which mysql")); $tar = … Continue reading

We are hiring: Developers wanted

That time has come that Sonassi is looking for some additional staff to help our day to day running. We’re hoping to pick a few happy developers from the unemployed-recession pile and take them under our wing. Whether you are an experienced developer or you have some mild experience, we might well be interested – as long as you have had some experience in the below technologies. Magento [Templating/Extension development/Integration/Maintenance] WordPress [Templating/Maintenance/Integration/Plugin Development] Object oriented PHP Javascript development, jQuery or Prototype libraries So if you feel you’ve got the skills to join us, get in touch

Magento PayPoint/Meta-Charge extension fault and fixes (PayPoint Fastrack 1.3.1)

At a customers request we were given the opportunity to use PayPoint/Meta-Charge as the payment gateway. As an extension already existed there was little point re-inventing the wheel, so we took advantage of PayPoint Fastrack by Deeson Group Ltd. However, after a few days use it was become apparent there was a bug with the extension when handling some payment types. URL: not available Time: 2009-11-10 11:13:13 GMT Error: Notice: Undefined property: stdClass::$amount in app/code/local/PaypointFastTrack/controllers/FastController.php on line 162 Looking at line 162, it reveals 161 // We get the amount without the currency prepended to it 162 $split_amount = explode($this->getConfig()->getCurrency(),$this->responseArr->amount); 163 $this->responseArr->intAmount = $split_amount[1]; Which all looked normal, so we dumped the object: stdClass Object ( [intTransID] => XX [strCartID] => XX [intAccountID] => XX [intAuthMode] => [intInstID] => XX [intStatus] => 1 [intTime] => XX [fltAmount] => 80.40 [strCurrency] => GBP [strPaymentType] => VISA [intCV2] => 1 [strCustomer] => … Continue reading

Magento eBay Extension (ESS-UA) bug fixes

We have been working on some mild Magento >< eBay integration using the extension above, but we had run into a few hurdles with the code, so we have improved portions of it. Prices displayed with 4 significant figures, line breaks not displayed in descriptions In the page body, prices were displayed as £18.5000 instead of £18.50 and the descriptive paragraph didn’t have any line breaks, just lin/unix nr terminators. This was a quick fix and only required a few lines to be changed. Start by editing your listing template and wrap your price #price# that is displayed in line in a simple span so we can preg_replace it. <span class="roundprice">#price#</span> Edit: app/code/local/Ess/Ebay/controllers/Adminhtml/EbayapiController.php Change from $request.='<Description><![CDATA['.$description[0]['value'].']]></Description>'; To $request.='<Description><![CDATA['.nl2br(preg_replace_callback('/<span class="roundprice">(.*?)</span>/is',create_function('$matches','return number_format($matches[1],2);'),$description[0]['value'])).']]></Description>'; Adding a custom label when using Selling Manager Pro If you also use Selling Manager Pro and you take advantage of the “custom label” feature, you can pass this data … Continue reading