{"id":523,"date":"2013-01-28T18:37:42","date_gmt":"2013-01-28T23:37:42","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2013\/01\/28\/using-lftp-mirror-to-copy-your-website-files\/"},"modified":"2021-08-16T23:23:34","modified_gmt":"2021-08-17T03:23:34","slug":"using-lftp-mirror-to-copy-your-website-files","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/","title":{"rendered":"Using lftp mirror to copy your website files"},"content":{"rendered":"<p>In this article I&#8217;m going to teach you how to use the <strong>lftp mirror<\/strong> command in order to copy your website files from another web host to your VPS (Virtual Private Server) or dedicated server with InMotion Hosting.<\/p>\n<p>The Linux <strong>lftp<\/strong> command is a sophisticated FTP\/HTTP client that is also capable of being able to mirror the entire contents of a remote website to your local server, or vice-versa. Using the <strong>lftp<\/strong> command on your server can help save you time when copying website files from a remote server.<\/p>\n<p>You can directly transfer the files right to your server, instead of having to first locally copy files to your desktop, just to upload them again to your server. Typically web hosts will have higher bandwidth connections than your residential Internet connection, so directly transferring files between two servers with <strong>lftp<\/strong> is an ideal method to use if you&#8217;ve got a lot of files to transfer.<\/p>\n<p class=\"alert\">In order to follow along with the steps below you&#8217;ll need to have either a VPS or dedicated server so that you have SSH access to your server in order to run the <strong>lftp mirror<\/strong> command.<\/p>\n<h2>lftp mirror remote files to your server<\/h2>\n<p>Using the steps below I&#8217;ll show you how to quickly connect to a remote server where you might have website files stored, and then mirror the entire contents of that website to your server using the <strong>lftp mirror<\/strong> commands.<\/p>\n<ol class=\"article_list\">\n<li><a href=\"\/support\/server\/ssh\/how-to-login-ssh\/\" target=\"\u201d_blank\u201d\" rel=\"noopener noreferrer\">Login to your server via SSH<\/a> with the cPanel user you&#8217;d like to copy remote files to.<\/li>\n<li>After logging into SSH run the following command to get to your public directory:\n<p><code>cd .\/public_html\/<\/code><br \/>\nYou can now run the following command to ensure you&#8217;re in the right directory:<\/p>\n<p><code>pwd<\/code><br \/>\nYou should get back something like this:<\/p>\n<p><code>\/home\/userna5\/public_html<\/code><\/p>\n<p class=\"alert\">In most cases your <strong>\/public_html\/<\/strong> directory should be empty if you haven&#8217;t placed any files on the server yet. If you wanted to do your file transfer to another directory such as a sub-directory, you would want to use the <strong>cd<\/strong> command again to end up in that directory.<\/p>\n<\/li>\n<li>In this example we&#8217;re going to connect to our old remote server at <strong>example.com<\/strong> using the FTP username <strong>userna5<\/strong> and the password of <strong>passWORD<\/strong>. Run the following command to begin our <strong>lftp<\/strong> session to this remote server:\n<p><code>lftp -u userna5,passWORD example.com<\/code><br \/>\nIf your FTP password includes special characters such as <strong>$<\/strong> or <strong>)<\/strong> you&#8217;d want to leave off the password like this, then type it in manually when prompted:<\/p>\n<p><code>lftp -u userna5 example.com<\/code><br \/>\nIn some cases certain servers will now allow you to connect with <strong>lftp<\/strong> with the default settings, you can try the following to connect to these type of servers:<\/p>\n<p><code>lftp -u userna5,passWORD example.com -e \"set ftp:ssl-allow off\"<\/code><br \/>\nYou should end up at the <strong>lftp<\/strong> prompt when you&#8217;ve successfully connected to the remote server, it would look like this:<\/p>\n<p><code>lftp userna5@example.com:~&gt;<\/code><\/li>\n<li>Now that you have a FTP connection established to the remote server, the next step is to change directories into the remote directory with your files. To view all of the folders on the remote server you can use the following command:\n<p><code>ls<\/code><br \/>\nIt should give you back something similar to this:<\/p>\n<p><code> lrwxrwxrwx    1 userna5    userna5            33 Jul 16  2011 access-logs -&gt; \/usr\/local\/apache\/domlogs\/userna5<br \/>\ndrwxr-xr-x    2 userna5    userna5          4096 Nov 20  2010 backup<br \/>\ndrwxr-x---    4 userna5    12               4096 Jan 28 14:14 etc<br \/>\ndrwxr-x--x   11 userna5    userna5         20480 Jan 10 12:52 mail<br \/>\ndrwxr-x---   11 userna5    99               4096 Jan 28 14:15 public_html<br \/>\ndrwxr-xr-x   10 userna5    userna5          4096 Jan 22 13:56 tmp<br \/>\nlrwxrwxrwx    1 userna5    userna5            11 Jul 16  2011 www -&gt; public_html <\/code><br \/>\nIn this case our website files are stored in the <strong>\/public_html\/<\/strong> directory so we can run the following command to get to this directory:<\/p>\n<p><code>cd public_html<\/code><\/li>\n<li>Now that you&#8217;ve changed into the remote directory where you&#8217;d like to mirror all of the files to your server from, run the following command to begin the file transfer:<br \/>\n<code>mirror -c<\/code>This uses the <strong>lftp mirror<\/strong> command to mirror the entire remote directory to our current local directory that we changed to prior to starting the transfer. The <strong>-c<\/strong> option is for continue and allows the mirror to continue from a previously failed transfer.<\/p>\n<p>After the file transfer has completed you should see the status of the full transfer which looks something like this:<\/p>\n<p><code> lftp userna5@example.com:\/public_html&gt; mirror -c<br \/>\nTotal: 175 directories, 1316 files, 0 symlinks<br \/>\nNew: 1316 files, 0 symlinks<br \/>\n20750001 bytes transferred in 20 seconds (1010.8K\/s)<br \/>\nTo be removed: 1 directory, 0 files, 0 symlinks <\/code><\/li>\n<li>Type either <strong>exit<\/strong> or <strong>quit<\/strong> to leave the <strong>lftp<\/strong> session:<br \/>\n<code>lftp userna5@example.com:\/public_html&gt; <strong>exit<\/strong><\/code><\/li>\n<\/ol>\n<p>You should now know how to use the <strong>lftp mirror<\/strong> command on your VPS or dedicated server in order to transfer over website files from a remote server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article I&#8217;m going to teach you how to use the lftp mirror command in order to copy your website files from another web host to your VPS (Virtual Private Server) or dedicated server with InMotion Hosting. The Linux lftp command is a sophisticated FTP\/HTTP client that is also capable of being able to<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/\"> Read More ><\/a><\/p>\n","protected":false},"author":57014,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4314],"tags":[],"class_list":["post-523","post","type-post","status-publish","format-standard","hentry","category-ftp"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Using lftp mirror to copy your website files | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"In this article I&#039;m going to teach you how to use the stronglftp mirror\/strong command in order to copy your website files from another web host to your VPS (Virtual Private Server) or dedicated server with InMotion Hosting.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using lftp mirror to copy your website files | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"In this article I&#039;m going to teach you how to use the stronglftp mirror\/strong command in order to copy your website files from another web host to your VPS (Virtual Private Server) or dedicated server with InMotion Hosting.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2013-01-28T23:37:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-17T03:23:34+00:00\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\"},\"headline\":\"Using lftp mirror to copy your website files\",\"datePublished\":\"2013-01-28T23:37:42+00:00\",\"dateModified\":\"2021-08-17T03:23:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/\"},\"wordCount\":681,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"FTP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/\",\"name\":\"Using lftp mirror to copy your website files | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2013-01-28T23:37:42+00:00\",\"dateModified\":\"2021-08-17T03:23:34+00:00\",\"description\":\"In this article I'm going to teach you how to use the stronglftp mirror\/strong command in order to copy your website files from another web host to your VPS (Virtual Private Server) or dedicated server with InMotion Hosting.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using lftp mirror to copy your website files\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/inmotion-hosting\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using lftp mirror to copy your website files | InMotion Hosting","description":"In this article I'm going to teach you how to use the stronglftp mirror\/strong command in order to copy your website files from another web host to your VPS (Virtual Private Server) or dedicated server with InMotion Hosting.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/","og_locale":"en_US","og_type":"article","og_title":"Using lftp mirror to copy your website files | InMotion Hosting","og_description":"In this article I'm going to teach you how to use the stronglftp mirror\/strong command in order to copy your website files from another web host to your VPS (Virtual Private Server) or dedicated server with InMotion Hosting.","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2013-01-28T23:37:42+00:00","article_modified_time":"2021-08-17T03:23:34+00:00","author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644"},"headline":"Using lftp mirror to copy your website files","datePublished":"2013-01-28T23:37:42+00:00","dateModified":"2021-08-17T03:23:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/"},"wordCount":681,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["FTP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/","name":"Using lftp mirror to copy your website files | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2013-01-28T23:37:42+00:00","dateModified":"2021-08-17T03:23:34+00:00","description":"In this article I'm going to teach you how to use the stronglftp mirror\/strong command in order to copy your website files from another web host to your VPS (Virtual Private Server) or dedicated server with InMotion Hosting.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/ftp\/using-lftp-mirror-to-copy-your-website-files\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Using lftp mirror to copy your website files"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/57014"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=523"}],"version-history":[{"count":3,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/523\/revisions"}],"predecessor-version":[{"id":85016,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/523\/revisions\/85016"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}