Take the 2-minute tour ×

Our current website is hosted by the design agency who originally built the website, however we are bringing the development of the website in house therefore need to export the database from their server and import it to ours.

We have FTP and phpMyAdmin access but don't have SSH access to the server. I was hoping to run a PHP script that would mysql dump the database, compress it and then copy it across to our server using scp:

$backupFile = $_SERVER['DOCUMENT_ROOT'].'/backup' . date("Y-m-d-H-i-s") . '.gz';

system("mysqldump -h DB_HOST -u DB_USER -pDB_PASS DB_NAME | gzip > $backupFile");

exec("sshpass -p PASSWORD scp -r -P PORT_NUMBER $backupFile USER@x.xx.xx.xxx:/path/to/directory/");

I have ran this locally from the command line and it worked fine, although I had to install sshpass (the hosting server might not have this installed). Also, I was hoping to run it from the browser as I don't have command line access on the hosting server, however it didn't work, no errors produced though.

Can you anyone recommend how I can export from the server that I don't have SSH access to and import to my server?


share|improve this question
add comment

1 Answer

Toad for MySQL if you can get in to port 3306

Export and Import

share|improve this answer
Thanks, I'll have a look into that now. –  Derek Carlisle Nov 12 '12 at 11:03
Is Toad a Windows program? I'm on linux sorry. –  Derek Carlisle Nov 12 '12 at 11:08
yes it is. are you looking for command line or a linux gui? Toad is free. There is RazorSQL with a 30day trial razorsql.com/download.html –  Drew Pierce Nov 12 '12 at 11:46
add comment

Your Answer


