{"id":12598,"date":"2022-06-06T06:10:34","date_gmt":"2022-06-06T06:10:34","guid":{"rendered":"https:\/\/blog.cloudthat.com\/?p=12598"},"modified":"2024-06-25T10:59:17","modified_gmt":"2024-06-25T10:59:17","slug":"simplify-cloud-data-migration-aws-datasync-amazons-online-data-transfer-service","status":"publish","type":"blog","link":"https:\/\/www.cloudthat.com\/resources\/blog\/simplify-cloud-data-migration-with-aws-datasync-amazons-online-data-transfer-service","title":{"rendered":"Simplify Cloud Data Migration with AWS DataSync \u2013 Amazon\u2019s Online Data Transfer Service"},"content":{"rendered":"<table style=\"height: 251px;\" border=\"3\" width=\"416\">\n<tbody>\n<tr>\n<td>\n<h2><span style=\"color: #000080;\"><strong>TABLE OF CONTENT<\/strong><\/span><\/h2>\n<\/td>\n<\/tr>\n<tr>\n<td><a href=\"#introduction\">1. Introduction to Amazon DataSync<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#stepstocovert\">2. Step to Covert your Linux machine into a Samba Server<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#createdatasyncagent \">3. Create a DataSync agent in EC2 in a VPC<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#createdatasyncawsportal\">4. Create the agent in the DataSync in the AWS Portal<br \/>\n<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#createatask\">5. Create a Task<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#startthetransfer\">6. Start the Transfer<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#summary\">7. Summary<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#aboutcloudthat\">8. About CloudThat <\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#faqs\">9. FAQs<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"introduction\">Introduction to AWS DataSync<\/h2>\n<p>There has been increased demand to back up our files to a cloud environment for long-term storage to cover any disaster-related incidents. Customers want to securely migrate their data with the help of reliable utility tools which help them to do so. Moreover, they want to automate these tasks through a reliable mechanism to transfer their data to the cloud-like AWS in S3, EFS, Windows file server, etc.<\/p>\n<p>AWS DataSync helps connect your on-prem storage to S3 and much more with a reliable automation architecture. File share systems like NFS (network file system) and SMB (Server Message Block) can now be integrated into AWS DataSync to transfer your required files.<\/p>\n<p>DataSync allows you to transfer all the files or only the changed data the next time you start transferring; it does so by using metadata related to previous data captured, which helps decrease the transfer size and the related time to transfer. AWS DataSync uses a DataSync agent, either installed on on-premises hardware such as VMware, Hyper-V, or an EC2 machine using AWS-provided AMI. This server helps in connecting the source endpoint of the local server to the target endpoint on S3 EFS, etc.<\/p>\n<p>I will be showing a small but powerful setup where you can transfer the files into the S3 from SMB (Samba) server using AWS data DataSync.<\/p>\n<h2 id=\"stepstocovert\">Step to Covert your Linux machine into a Samba Server<\/h2>\n<p>Here I am using an Amazon Linux AMI in another VPC to act as a remote Samba server<\/p>\n<ol>\n<li>Launch Linux EC2 of your choice here; I am using Amazon Linux to install the SMB server.<\/li>\n<li>In the security group, open port 22and port 445 to anywhere, i.e., 0.0.0.0\/0 range (later, we can change this to a dedicated IP)<\/li>\n<li>It is an Amazon Linux 2 AMI; we need to follow the below steps to change the hostname to a user-friendly name\n<pre class=\"theme:dark-terminal nums:false nums-toggle:false lang:default decode:true\">sudo vi \/etc\/cloud\/cloud.cfg<\/pre>\n<\/li>\n<li>At the end of the file, add the below line and save\n<pre class=\"theme:dark-terminal nums:false nums-toggle:false lang:default decode:true \">preserve_hostname: true<\/pre>\n<\/li>\n<li>Change Hostname\n<pre class=\"theme:dark-terminal nums:false nums-toggle:false lang:default decode:true\">$ sudo hostnamectl set-hostname samba-server\r\n$ sudo yum update -y\r\n$ sudo reboot<\/pre>\n<\/li>\n<li>Install Samba, Samba-client, and cifs-utils\n<pre class=\"theme:dark-terminal nums:false nums-toggle:false lang:default decode:true \">$ sudo su -\r\n# yum install -y samba samba-client cifs-utils<\/pre>\n<\/li>\n<li>Configuration file changes\n<pre class=\"theme:dark-terminal nums:false nums-toggle:false lang:default decode:true \"># vim \/etc\/samba\/smb.conf<\/pre>\n<pre class=\"theme:dark-terminal nums:false nums-toggle:false lang:default decode:true\">security = user\r\n        hosts allow = ip address of Data DataSync agent VM  \r\n*** Add the loopback IP and the VPC starting ip as shown above\r\n        interfaces = lo eth0        passdb backend = smbpasswd:\/etc\/samba\/sambapasswd.txt        printing = cups\r\n        printcap name = cups\r\n        load printers = yes\r\n        cups options = raw\r\n[homes]\r\n        comment = Home Directories\r\n        valid users = %S, %D%w%S\r\n        browseable = No\r\n        read only = No\r\n        inherit acls = Yes\r\nprinters]\r\n        comment = All Printers\r\n        path = \/var\/tmp\r\n        printable = Yes\r\n        create mask = 0600\r\n        browseable = No\r\n[print$]\r\n        comment = Printer Drivers\r\n        path = \/var\/lib\/samba\/drivers\r\n        write list = @printadmin root\r\n        force group = @printadmin\r\n        create mask = 0664\r\n        directory mask = 0775\r\n[samba]\r\n        comment = Development documentation\r\n        read only = no\r\n        available = yes\r\n        path = \/smbfolder\r\n        public = yes\r\n        valid users = sambauser\r\n        write list = sambauser\r\n        writable = yes\r\n        browseable = yes<\/pre>\n<p>Make sure to edit the config as above and change the host allow to your data DataSync agent to connect<\/li>\n<li>We will now create a samba user to access the samba folder directory\n<pre class=\"theme:dark-terminal nums:false nums-toggle:false lang:default decode:true\"># useradd sambauser\r\n# passwd sambauser\r\n# smbpasswd -a sambauser\r\n# service smb restart<\/pre>\n<\/li>\n<li>Create a directory for file share and give permissions\n<pre class=\"theme:dark-terminal nums:false nums-toggle:false lang:default decode:true \"># mkdir \/smbfolder\r\n# chmod 777 \/smbfolder<\/pre>\n<\/li>\n<li>Restart and test with the data DataSync agent\n<pre class=\"nums:false nums-toggle:false lang:default decode:true \"># service smb restart\r\n# testparm<\/pre>\n<\/li>\n<\/ol>\n<h2 id=\"createdatasyncagent\">Create a DataSync agent in EC2 in a VPC<\/h2>\n<p>You can choose your DataSync AMI using the below command<br \/>\n<a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/SMB1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12600\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/SMB1.png\" alt=\"AWS DataSync\" width=\"627\" height=\"176\" \/><\/a><\/p>\n<p><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/SMB2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12601\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/SMB2.png\" alt=\"AWS DataSync\" width=\"631\" height=\"163\" \/><\/a><\/p>\n<h2 id=\"createdatasyncawsportal\">Create the agent in the DataSync in the AWS Portal by navigating to DataSync in the AWS Console<\/h2>\n<p>Place the Data DataSync agent ID in the agent address<\/p>\n<p><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/SMB3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12602\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/SMB3.png\" alt=\"AWS DataSync\" width=\"631\" height=\"334\" \/><\/a><\/p>\n<p><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/SMB4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12604\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/SMB4.png\" alt=\"AWS DataSync\" width=\"631\" height=\"404\" \/><\/a><\/p>\n<h2 id=\"createatask\">Create a Task<\/h2>\n<ul>\n<li>Choose location type as SMB server<\/li>\n<li>Choose the Data DataSync agent you configured<\/li>\n<li>Put IP of SMB server launched up earlier<\/li>\n<li>Share the name for the folder<\/li>\n<li>User and Password for SMB server user<\/li>\n<li>Choose destination location type as S3 \/ EFS\/ NFS as per requirement<\/li>\n<li>Give the task a name and verify the options selected in the review screen<\/li>\n<\/ul>\n<p><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/SMB5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12605\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/SMB5.png\" alt=\"AWS DataSync\" width=\"631\" height=\"241\" \/><\/a><\/p>\n<h2 id=\"startthetransfer\">Start the transfer<\/h2>\n<p>Once the task is created you can start transferring files using the start tab above<\/p>\n<p><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/SMB6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12603\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/SMB6.png\" alt=\"AWS DataSync\" width=\"631\" height=\"120\" \/><\/a><\/p>\n<p>Navigate to the S3 bucket and now you can find the files transferred<\/p>\n<p><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/SMB7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12606\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/SMB7.png\" alt=\"AWS DataSync\" width=\"631\" height=\"236\" \/><\/a><\/p>\n<h3 id=\"summary\">Summary<\/h3>\n<p>Data DataSync helps create a reliable connection between your on-premises storage to AWS S3 \/ EFS\/ NFS servers to transfer data. You can also change the storage classes to store the data when it comes to S3 as the destination. By clicking start on tasks, you can start transferring all the files or files that are not yet transferred. You can also delete the files in AWS storage by choosing the delete option to DataSynchronize your on-premises drives completely.<\/p>\n<h3 id=\"aboutcloudthat\">About CloudThat<\/h3>\n<p>Here at\u00a0<a href=\"https:\/\/www.cloudthat.com\/\">CloudThat\u00a0<\/a>are the official AWS (Amazon Web Services) Advanced Consulting Partner and Training partner and Microsoft gold partner, helping people develop knowledge of the cloud and help their businesses aim for higher goals using best in industry cloud computing practices and expertise. We are on a mission to build\u00a0a robust\u00a0cloud computing ecosystem by disseminating\u00a0knowledge on technological intricacies within the cloud space.\u00a0Our blogs, webinars,\u00a0case studies, and white papers\u00a0enable all the stakeholders in the cloud computing sphere.<\/p>\n<p>Feel free to drop a comment or any queries that you have regarding AWS services, cloud adoption, or consulting and we will get back to you quickly. To get started, go through\u00a0our\u00a0<a href=\"https:\/\/www.cloudthat.com\/expert-advisory\/?utm_source=blog-website&amp;utm-medium=text-link&amp;utm_campaign=expert-advisory\">Expert Advisory\u00a0<\/a>page\u00a0and\u00a0<a href=\"https:\/\/www.cloudthat.com\/managed-services-packages\/\">Managed Services Package<\/a>\u00a0that is\u00a0<a href=\"https:\/\/cloudthat.com\/?utm_source=blog-website&amp;utm-medium=text-link&amp;utm_campaign=cloudthat.com\/\">CloudThat<\/a>\u2019s\u00a0offerings.<\/p>\n<h3 id=\"faqs\">FAQs<\/h3>\n<ol>\n<li><span style=\"text-decoration: underline;\"><strong>Which file system is from where we can replicate our data to AWS?<\/strong><\/span><\/li>\n<\/ol>\n<p>Ans: File systems such as NFS, SMB, and HDFS can be set up for on-premises storage locations. Moreover, <a href=\"https:\/\/blog.cloudthat.com\/introduction-to-amazon-elastic-file-system-step-by-step-aefs-replication-guide\/?utm_source=blog-website&amp;utm-medium=text-link&amp;utm_campaign=introduction-to-amazon-elastic-file-system-step-by-step-aefs-replication-guide\" target=\"_blank\" rel=\"noopener\"><strong>Amazon EFS<\/strong><\/a>, Amazon FSx, and AWS S3 can also be made as source points for data capture.<\/p>\n<ol start=\"2\">\n<li><span style=\"text-decoration: underline;\"><strong>Can we change the storage class when choosing the destination location to AWS S3?<\/strong><\/span><\/li>\n<\/ol>\n<p>Ans: Yes, at any point in time, once the AWS DataSync agent is set up, you can change the storage class for a new task where the destination is S3, such as Standard, Glacier, or Deep-archive.<\/p>\n<ol start=\"3\">\n<li><span style=\"text-decoration: underline;\"><strong>Can we use CloudWatch to monitor Data DataSync tasks?<\/strong><\/span><\/li>\n<\/ol>\n<p>Ans: Yes, you can monitor the files which are copied using AWSDataSync through <a href=\"https:\/\/blog.cloudthat.com\/how-cloudwatch-synthetics-helps-in-application-monitoring\/?utm_source=blog-website&amp;utm-medium=text-link&amp;utm_campaign=how-cloudwatch-synthetics-helps-in-application-monitoring\" target=\"_blank\" rel=\"noopener\"><strong>AWS CloudWatch<\/strong><\/a> metrics.<\/p>\n","protected":false},"author":278,"featured_media":12636,"parent":0,"comment_status":"open","ping_status":"open","template":"","blog_category":[3606,3607],"user_email":"akshaym@cloudthat.com","published_by":"324","primary-authors":"","secondary-authors":"","acf":[],"_links":{"self":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/12598"}],"collection":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/users\/278"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/comments?post=12598"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/12598\/revisions"}],"predecessor-version":[{"id":42366,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/12598\/revisions\/42366"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/media?parent=12598"}],"wp:term":[{"taxonomy":"blog_category","embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog_category?post=12598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}