{"id":141,"date":"2008-11-21T10:31:13","date_gmt":"2008-11-21T09:31:13","guid":{"rendered":"http:\/\/www.askthegerman.com\/?p=141"},"modified":"2023-02-13T07:36:24","modified_gmt":"2023-02-13T06:36:24","slug":"transfering-data-from-server-to-server","status":"publish","type":"post","link":"https:\/\/www.askthegerman.com\/?p=141","title":{"rendered":"Transfering data from server to server"},"content":{"rendered":"<p>When transferring data from one server to another &#8211; maybe for backup reason &#8211; most people use tar to create an archive. Then they copy it to the new server and untar it or leave it as a tarfile as backup.<\/p>\n<p>Working with UNIX and using a trick&nbsp; you can transfer it with compression and speed up the whole transfer time a lot.<\/p>\n<p>Using the output result of&nbsp; a command directly as the command line input of a second command&nbsp; using a&nbsp; Unix Pipe the need of writing it down to disk first no longer exists. Finally accessing the remote system though a ssh tunnel will even transfer the compressed data over the network within one single step.<\/p>\n<p>Invoking the following single command will transfer all your data within sourcedirectory an Server B and immediately store it locally&nbsp; on Server B within a compress archive:<\/p>\n<p><em>ssh username@hostname &#8220;cd \/sourcedirectory\/ ; tar czf &#8211; .&#8221; &gt; \/targetdirectory\/filename.tgz<\/em><\/p>\n<p>While the following variation:<\/p>\n<p><em>ssh username@hostname &#8220;cd \/sourcedirectory\/ ; tar czf &#8211; .&#8221;&gt; \/targetdirectory\/filename.tgz| tar xvf &#8211;<\/em><\/p>\n<p>will directly extract it again for you on the your local system.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When transferring data from one server to another &#8211; maybe for backup reason &#8211; most people use tar to create an archive. Then they copy it to the new server and untar it or leave it as a tarfile as backup. Working with UNIX and using a trick&nbsp; you can transfer it with compression and [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[260,14,31,15],"tags":[148,147,151,150,81,149,77,263],"class_list":["post-141","post","type-post","status-publish","format-standard","hentry","category-backup","category-operatingsystem","category-tipsntricks","category-unix","tag-file-transfer","tag-network","tag-pipe","tag-secure-shell","tag-server","tag-ssh","tag-tar","tag-unix"],"_links":{"self":[{"href":"https:\/\/www.askthegerman.com\/index.php?rest_route=\/wp\/v2\/posts\/141","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.askthegerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.askthegerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.askthegerman.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.askthegerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=141"}],"version-history":[{"count":8,"href":"https:\/\/www.askthegerman.com\/index.php?rest_route=\/wp\/v2\/posts\/141\/revisions"}],"predecessor-version":[{"id":366,"href":"https:\/\/www.askthegerman.com\/index.php?rest_route=\/wp\/v2\/posts\/141\/revisions\/366"}],"wp:attachment":[{"href":"https:\/\/www.askthegerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.askthegerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.askthegerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}