{"id":117,"date":"2006-08-21T22:46:00","date_gmt":"2006-08-21T22:46:00","guid":{"rendered":"http:\/\/blog.trungson.com\/?p=117"},"modified":"2006-08-21T22:46:00","modified_gmt":"2006-08-21T22:46:00","slug":"scp-copy-files-to-another-server-in-ssh","status":"publish","type":"post","link":"http:\/\/blog.trungson.com\/?p=117","title":{"rendered":"scp &#8211; Copy files to another server in SSH"},"content":{"rendered":"<p>Say you need to replicate a huge MySQL database to another machine and dumping and import the database might take hours, copy the binary files (\/var\/lib\/mysql\/DB_NAME) might be a quicker method. To do that, we can use scp: <\/p>\n<p>s1# scp -P SSH_PORT \/var\/lib\/mysql\/DB_NAME\/ user@s2:\/var\/lib\/mysql\/DB_NAME\/ <\/p>\n<p>You would also need to chmod (644) &#038; chown (mysql:mysql) the files on the destination server so MySQL server can read them properly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Say you need to replicate a huge MySQL database to another machine and dumping and import the database might take hours, copy the binary files (\/var\/lib\/mysql\/DB_NAME) might be a quicker method. To do that, we can use scp: s1# scp -P SSH_PORT \/var\/lib\/mysql\/DB_NAME\/ user@s2:\/var\/lib\/mysql\/DB_NAME\/ You would also need to chmod (644) &#038; chown (mysql:mysql) the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts\/117"}],"collection":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=117"}],"version-history":[{"count":0,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts\/117\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}