Set up periodically back up files to Amazon S3 from Windows folder
In the past few years, data backup products have continuously developed many advanced features to serve the enterprise audience. In addition to backup features for data objects such as files, virtual machines, and databases, features such as anti-ransomware, backup old data to storage platforms on the cloud are also introduced. However, for a lot of small businesses with relatively modest data, mainly file storage, the copyright investment in backup software with many unused features will lead to waste of money and money. original. These businesses often aim to buy cloud storage services to synchronize data at a low cost, and including Amazon Simple Storage Service (Amazon S3) from Amazon Web Services (AWS) is also chosen by many enterprise customers.
Introduction to Amazon Simple Storage Service (Amazon S3)
Amazon S3 is an object storage service pioneering in cloud storage and leading the market in scalability, high availability up to 99.999999999%, security, and performance. Amazon S3 is suitable for a lot of customers from small to large, suitable for many usage scenarios from common data storage to serving today’s “hot” fields like AI / ML, specialties data analytics, or IoT. Amazon S3 provides easy-to-use management features, easy to control access, and ensures long-term storage of data.
Guide to install backup solution
In the scope of this article, VTI Cloud will guide the use of Amazon S3 as a service to synchronize and backup data from the enterprise file server (using Windows operating system) according to a predetermined schedule using AWS CLI and Windows Task Scheduler. The outstanding features of this backup solution can be mentioned:
- Backup periodically hourly, daily, weekly, monthly according to the configuration of Task Scheduler.
- Back up only the first full copy, next time only backup files that have changed.
- The archiving feature of multiple file versions can be used after changes based on the S3 versioning feature (Bucket Versioning). At the same time, S3 also provides lifecycle management for file versions (Lifecycle Rules) to automatically switch to a more cost-optimized storage class.
Step 1: Create an IAM user with S3 access (Mandatory)
IAM is an identity and access management service for services on the AWS platform.
1.1. To create an IAM user, we log into the console with the root account or an account with administrator rights, find the IAM service → select Users → select Add user.
1.2. Enter the new username, for example, s3backup, select the Access type as Programmatic access. For the purposes of this article, we only need access to the AWS CLI so we don’t need access to the Console.
1.3. Select Next: Permissions → select Attach existing policies directly → find and select policy AmazonS3FullAccess → select Next: Tags → select Next: Review in the next page.
Note: For tutorial purposes, the demo should be new to AmazonS3FullAccess permission. On a production environment, the IAM user’s authority should be limited to more granularity (applying additional conditions), for example, only FullAccess can be used for a certain bucket.
1.4. After rechecking the selected information, select Create user.
1.5. On the next page, we can choose to download user information by CSV file or save our information Access key ID and Secret access key.
Step 2: Create S3 bucket (Mandatory)
2.1. After creating the IAM user, we continue to create a storage place on the S3 service, called a bucket. To create an S3 bucket, we look for an S3 service.
2.2. Select Create bucket → enter a name for the bucket, for example, vticloud-s3-backup → select Region where you want to save your data, set the remaining items to default → select Create bucket.
Once created, we will see the bucket on the S3 service console.
Step 3: File versioning (Optional)
3.1. Go to bucket → select tab Properties → in Bucket Versioning, select Edit.
3.2. On the next page, select Enable and Save Changes. After enabling this feature, by default all uploaded changed files will create a new version and the old version will remain until deleted by the user or automatically deleted by the admin feature. bucket life cycle.
3.3. Enabling version markers has always been associated with growing concerns about data from older versions of files being kept constantly, causing costly storage costs. To solve this problem, S3 provides lifecycle management of file versions. To configure this feature select the Management tab in the bucket → in Lifecycles rules, select Create lifecycle rule.
3.4. On the next page, enter the name you want to give the rule to → select This rule applies to all objects in the bucket → in Lifecycle rule actions, select Permanently delete previous versions of objects → enter the number of days in the new entry, versions that exceed this number will be deleted → finally, select Create rule.
So we have created and configured the S3 bucket for the backup file. Followed by instructions for installing AWS CLI and setting up Windows Task Scheduler on file server in the enterprise.