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