# Migrate from AWS S3 storage to Zata.ai S3 storage

**Prerequisites**

* Select any Linux operating system to perform the migration process.
* In this setup, we have chosen **Ubuntu 22.04** as the operating system.
* Click on the provided link to **Launch the Instance** [Instance](https://docs.neevcloud.com/neevcloud-products/computes/getting-started-launch-vms).

**AWS Setup**

For AWS configuration:

* Log in to the **AWS Management Console**.
* This console will be used to create and manage the S3 bucket and generate access credentials required for migration.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2FaXqOsWTR10IPY12ULeoc%2Fimage.png?alt=media&#x26;token=27bbf679-5335-4547-9cfc-c1f8bb2513cd" alt=""><figcaption></figcaption></figure>

**Create a Bucket in AWS S3**

* After logging in to the AWS Management Console, search for **S3** in the services search bar.
* Open the **S3** service and click on **Create bucket**.
* Provide the required details such as bucket name and region, and complete the bucket creation process.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2F6SiB2as25rgtzd4nZTXX%2Fimage.png?alt=media&#x26;token=0ecc32fb-4d89-49b0-af9f-ed8ab248bc50" alt=""><figcaption></figcaption></figure>

**Set Bucket Policy and Permissions**

* After creating the bucket, apply the required bucket permissions and bucket policy.
* Click on the created bucket, then navigate to **Permissions → Bucket Policy → Edit**.
* Update the policy by modifying the bucket name, user name, and user account ID according to your requirements before saving it.

{% hint style="info" %}
When applying a bucket policy, ensure you customize the values based on your requirements. Do not copy this policy directly.
{% endhint %}

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2FHYyPUEaa11AweCSDhF7g%2Fimage.png?alt=media&#x26;token=e66e9a02-f4a4-4717-91fb-2b171b0df48a" alt=""><figcaption></figcaption></figure>

**Create Access and Secret Key**

* Navigate to the **IAM** service from the AWS Management Console.
* Go to the **Users** section and select an existing user to create an access and secret key.
* If the user does not exist, create a new user and assign **AdministratorAccess** permissions.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2FEWXuoQg8NPd4ija2uKNn%2Fimage.png?alt=media&#x26;token=66534415-6c7f-46d1-af3c-6e16fc384622" alt=""><figcaption></figcaption></figure>

Verify that the selected user has sufficient permissions to access and manage the S3 buckets. Then, navigate to the **Security Credentials** section to generate the Access Key ID and Secret Access Key.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2Fy9yth2xWg74absw1kch8%2Fimage.png?alt=media&#x26;token=9a432719-13b4-46f4-b27d-2fc57b6b6cab" alt=""><figcaption></figcaption></figure>

Now create the security credentials to click on the security credentials to create the access key.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2FRxWPKLVjj4yfcDhietoe%2Fimage.png?alt=media&#x26;token=4ff29b40-8879-4a97-a085-1504b9228694" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2FCZhOfjZ4j4WHjo7DAPbO%2Fimage.png?alt=media&#x26;token=22723fd8-9f4a-4924-8919-ac960e910b0c" alt=""><figcaption></figcaption></figure>

Before clicking on "Done," first copy the access and secret keys to your notepad.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2FQD1auNeGk0OBjB5PpWgo%2Fimage.png?alt=media&#x26;token=919ae9d3-897e-4427-8ba8-3ac6febe9651" alt=""><figcaption></figcaption></figure>

After performing these processes in AWS, configure the Zata.ai settings.

**Setup Zata.ai**

For Zata.ai configuration:

* Open the Zata.ai login page and sign in to your account [login page](https://auth.zata.ai/realms/zata/protocol/openid-connect/auth?client_id=zatacloud_client\&redirect_uri=https%3A%2F%2Fmy.zata.ai%2F\&state=dd2b5305-f7f5-4922-8639-4b0c62060c2f\&response_mode=fragment\&response_type=code\&scope=openid\&nonce=646d8811-0870-469c-9045-9e13d0fdd1b3\&code_challenge=wRG6I1qb9wdmY4unvHhPYaYq5WWM-801w72AYyLi8xY\&code_challenge_method=S256).
* Create a bucket by following the *Zata Bucket Creation Guide* [Bucket Creation Guide](https://docs.zata.ai/manage/bucket/create-bucket)
* Generate the Access Key ID and Secret Access Key by following the *Access Keys Guide* [Access Keys Guid](https://docs.zata.ai/manage/access-keys/creating-a-new-access-key)e
* Refer to the Zata.ai documentation for more detailed information and features [zata.ai](https://zata.ai/)

**Guide to Move Data from AWS to Zata.ai**

Ubuntu 22.04 is used as an intermediary system to facilitate the data migration from AWS S3 to Zata.ai S3. This system acts as a bridge between both storage platforms during the transfer process.

For the first process (AWS side setup):

* Update and upgrade the Ubuntu system to ensure all packages are up to date.

```
sudo apt-get update -y
sudo apt-get upgrade -y
```

{% hint style="info" %}
For migrating data from AWS to Zata.ai, use **rclone**
{% endhint %}

### Install the configure the rclone <a href="#install-the-configure-the-rclone" id="install-the-configure-the-rclone"></a>

Install and configure the rclone.

```
sudo apt-get install rclone -y
```

* To migrate data, rclone must be configured for both AWS and Zata.ai.
* First, configure rclone for AWS, and then configure it for Zata.ai.
* Run the following command to start the rclone configuration:

```
sudo rclone config
```

* When the rclone configuration starts, choose **`n`** to create a new remote.
* Enter **AWS** as the name of the remote.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2F89wKTEaqE9lpvChHHsA3%2Fimage.png?alt=media&#x26;token=1357083f-23cc-4398-8eb2-480499da93d0" alt=""><figcaption></figcaption></figure>

For the storage type, choose option **`4`** to select the AWS S3–compliant storage provider.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2F4c6Vnqwu9YLgGpRPFBgf%2Fimage.png?alt=media&#x26;token=5c81679b-ccdb-485d-a5a4-6eb27a05f246" alt=""><figcaption></figcaption></figure>

Select your S3 provider by choosing option **`1`** for **AWS S3**.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2Fj4A7vNkNBFLgtri4t7Gu%2Fimage.png?alt=media&#x26;token=8919c57c-31d4-4378-952d-50babee7884a" alt=""><figcaption></figcaption></figure>

* When prompted for `env_auth`, select **false** (press Enter to use the default value).
* This option is used only if credentials are taken from environment variables or EC2/ECS metadata.
* Since the Access Key ID and Secret Access Key were already created in the AWS section, manual entry will be used.
* Enter the **AWS Access Key ID** and **AWS Secret Access Key** when prompted.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2F6tvn5KJzMTxJgYq9h7MP%2Fimage.png?alt=media&#x26;token=8a33f798-6018-4c93-8785-5c0053a0f6f8" alt=""><figcaption></figcaption></figure>

* Set the endpoint according to your AWS region.
* In our case, we are using the **Mumbai region**, so the endpoint is:

  ```
  s3.ap-south-1.amazonaws.com
  ```
* When asked for the region, choose option **`17`** for **Asia Pacific (Mumbai)**.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2FZJzXN0Arj8zRZjFUi6pA%2Fimage.png?alt=media&#x26;token=13c753a0-dc1f-46a3-9b32-27f9c83825e4" alt=""><figcaption></figcaption></figure>

* When prompted for the S3 API endpoint, enter the following value:

  ```
  s3.ap-south-1.amazonaws.com
  ```
* This sets the S3 API endpoint for the Mumbai (Asia Pacific) region.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2FS0TRpFVj2pjGkxm4zIEI%2Fimage.png?alt=media&#x26;token=b1cf2186-df2a-4219-a3bf-31cdeff077f8" alt=""><figcaption></figcaption></figure>

* Press **Enter** to accept all default values.
* When prompted for **Storage Class**, change the value and choose option **`2`**.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2FCY2UsjDDKgPVZ59Dsu0x%2Fimage.png?alt=media&#x26;token=a285af42-621c-492e-a223-9dd8da46928b" alt=""><figcaption></figcaption></figure>

* For the ACL option, choose **`4`**.
* This setting applies only when creating buckets.
* Keep all remaining options as default by pressing **Enter** until the configuration is completed.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2F7JR8LMAamo1qqKwSaOo1%2Fimage.png?alt=media&#x26;token=2101506d-0309-4fdc-9f01-4621933fed4b" alt=""><figcaption></figcaption></figure>

This is the remote configuration completed after following these steps:

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2FelkgnwkF1Jma7exPpc0Q%2Fimage.png?alt=media&#x26;token=13102935-fc79-4f0f-b53e-1f3ca2d762d1" alt=""><figcaption></figcaption></figure>

### Second process for Zata.ai

**Configure rclone for Zata.ai**

* Choose **`n`** to create a new remote.
* Set the remote name as **zata**.
* Choose option **`4`** for **S3 Compliant Storage Provider**.
* Choose option **`13`** for **S3 Compatible Provider**.
* Set `env_auth` to **false** to use manual credentials.
* Enter the **Zata Access Key ID** and **Zata Secret Access Key** (refer to the Access Keys Guide).[Access Keys Guid](https://docs.zata.ai/manage/access-keys/creating-a-new-access-key)e
* Set the endpoint as:

  ```
  idr01.zata.ai
  ```

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2F7UDrr2kg9mZbGUnBXH0s%2Fimage.png?alt=media&#x26;token=8b361531-935e-4c8c-8dc9-7caf11bc0e60" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Ensure you have created buckets in both **AWS** and Zata.ai before running these commands.
{% endhint %}

**Copy Data from AWS S3 to Zata.ai S3**

* After completing the rclone configuration for both AWS and Zata.ai, you can start the data transfer.
* Use the following command to copy data from the AWS bucket to the Zata.ai bucket:

```bash
rclone copy AWS:<aws_bucket_name> zata:<zata_bucket_name> --s3-region ap-south-1 --progress
```

* Replace `<aws_bucket_name>` with your AWS S3 bucket name.
* Replace `<zata_bucket_name>` with your Zata.ai bucket name.
* The `--progress` option shows real-time transfer status.
* This command securely copies all objects from AWS S3 to Zata.ai S3.

<figure><img src="https://2683631041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPPVG4W649TwXN8OejRhb%2Fuploads%2Fgc3QntDOGXZac9RftSId%2Fimage.png?alt=media&#x26;token=4feed9e8-223a-4825-bc39-cb1575ed1206" alt=""><figcaption></figcaption></figure>

After completing the data transfer, return to both the AWS S3 console and the Zata.ai dashboard to verify the status of the buckets and confirm that all data has been successfully copied.
