Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (83 sloc) 2.28 KB

Google Cloud Storage

1. Export: Zaius to Amazon S3

Using the Zaius Export API you can export all data from Zaius to an Amazon S3 bucket.

Example

{% code-tabs %} {% code-tabs-item title="zaius-export.sh" %}

#!/bin/sh
curl -X POST \
  'https://api.zaius.com/v3/exports' \
  -d '{
    "objects": [
      "events",
      "customers",
      "orders",
      "products",
      "categories",
      "lists",
      "list_members",
      "customer_observations",
      "customer_insights",
      "product_insights",
      "category_insights"
    ],
    "format": "parquet"
  }' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOURKEYHERE'

{% endcode-tabs-item %} {% endcode-tabs %}

Make Script Executable

chmod +x zaius-export.sh

Schedule Export

Edit Crontab

crontab -e

Add Script to Crontab

{% code-tabs %} {% code-tabs-item title="crontab" %}

@daily /path/to/your/script/zaius-export.sh

{% endcode-tabs-item %} {% endcode-tabs %}

2. Import: S3 to Google

Generate S3 Bucket & Credentials

  1. Go to Account Settings -> Administration -> Integrations

  2. Select the AWS tile

  3. Select "Generate Access Keys"

Create a Google Cloud Bucket

  1. Go to Google Cloud Storage

  2. Create a Bucket

Select "Create Bucket"

Give the bucket a unique name e.g. zaius-mycompany-export

Transfer Files

  1. Install gsutil

  2. Ensure you have generated an authentication file

gcloud config set pass_credentials_to_gsutil false
gsutil config
  1. After you run the config command, you'll see this in your ~/.boto file:
# To add aws credentials ("s3://" URIs), edit and uncomment the
# following two lines:
# aws_access_key_id = 
# aws_secret_access_key = 
  1. Execute

{% code-tabs %} {% code-tabs-item title="crontab" %}

gsutil -m cp -R s3://zaius-outgoing/{INSERT-TRACKER-HERE}/data-exports gs://zaius-example-export

{% endcode-tabs-item %} {% endcode-tabs %}

You can’t perform that action at this time.