`mysqldump -C -u$config{local_db_user} -p$config{local_db_pass} $config{local_db_name} > $config{remote_db_name}.sql`;
print "Compressing DB...\n";
`mysqldump -C -u$config{local_db_user} -p$config{local_db_pass} $config{local_db_name} > $config{remote_db_name}.sql`;
print "Compressing DB...\n";
# upload db
print "Uploading DB...\n";
my $scp = Net::SCP->new($config{remote_host}, $config{remote_user});
# upload db
print "Uploading DB...\n";
my $scp = Net::SCP->new($config{remote_host}, $config{remote_user});
$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;
$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 "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");
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");