# upload db
print "Uploading DB...\n";
my $scp = Net::SCP->new($config{remote_host}, $config{remote_user});
-$scp->put("$config{remote_db_name}.tar.gz");
+$scp->put("$config{remote_db_name}.tar.gz") or die $scp->{errstr};
print "Logging to $config{remote_host}...\n";
-my $ssh = Net::SSH::Perl->new($config{remote_host}, debug=>0);
+my %params;
+$params{port} = $config{remote_port};
+$params{debug} = 0;
+$params{use_pty} = 1;
+my $ssh = Net::SSH::Perl->new($config{remote_host}, %params);
$ssh->login($config{remote_user}, $config{remote_pass});
print "Unpacking DB...\n";
my ($stdout, $stderr, $exit) = $ssh->cmd("tar -xzvf $config{remote_db_name}.tar.gz");
print $stdout;
+print $stderr;
+
print "Loading DB...\n";
($stdout, $stderr, $exit) = $ssh->cmd("mysql -u$config{remote_db_user} -p$config{remote_db_pass} $config{remote_db_name} < $config{remote_db_name}.sql");