> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dataraven.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Cross-Region Bucket Replication

> Set up automated cross-region replication for Railway buckets

This guide walks through setting up automated cross-region replication for Railway Buckets using
DataRaven's scheduled tasks.

## Prerequisites

* A [Railway account](https://railway.app) with active project(s)
* Railway Buckets in at least two regions that you want to replicate
* DataRaven account with team access

<Info>
  Railway Buckets provide S3-compatible object storage. DataRaven treats them as object storage
  locations, enabling automated replication across regions.
</Info>

## Step 1: Gather Your Bucket Credentials

For each bucket you want to replicate, you'll need to collect the S3 credentials from the Railway
console:

1. Open your [Railway dashboard](https://railway.app/dashboard)
2. Navigate to your project and select the bucket
3. Go to the **Credentials** tab
4. Note the following values:
   * **Bucket Name**: e.g., \`dr-bak-west-0iofqnrozari\`\`
   * **Access Key ID**: Your S3 access key
   * **Secret Access Key**: Your S3 secret key
   * **Endpoint URL**: e.g., `https://t3.storageapi.dev`

Repeat this process for both your source and destination buckets.

## Step 2: Configure Source Bucket Location

### Via DataRaven Dashboard

1. Go to **Locations** in your team workspace

2. Click **Add Location**

3. Select **Railway** as the provider type

4. Fill in the following details:
   * **Display Name**: e.g., "Railway US-East Bucket"
   * **Bucket Name**: The bucket name from your credentials (e.g., `dr-bak-west-0iofqnrozari`)
   * **Access Key ID**: Your S3 access key (or reference a
     [vault secret](/vault-integration))
   * **Secret Access Key**: Your S3 secret key (or reference a
     [vault secret](/vault-integration))
   * **Endpoint URL**: The endpoint from your credentials (e.g., `https://t3.storageapi.dev`)

5. Click **Test** to verify the connection

6. Click **Save**

## Step 3: Configure Destination Bucket

1. Repeat Step 2 for your destination bucket
2. Use the **Display Name**: e.g., "Railway EU-West Bucket"
3. Use the bucket name and credentials for your destination bucket (e.g.,
   `dr-bak-west-0iofqnrozari`)

## Step 4: Create a Replication Task

1. Navigate to **Tasks** in your workspace
2. Click **Create Task**
3. Configure the task:
   * **Task Name**: e.g., "Replicate US→EU Buckets"
   * **Source Location**: Select your source Railway bucket
   * **Destination Location**: Select your destination Railway bucket
   * **Task Type**: Choose `sync` (one-way sync) or `copy` (copies new/changed files without
     deleting)
   * **Filters**: Optionally set path filters to replicate only specific directories or file types

### Schedule Options

Use cron expressions to set when your replication runs. Enter a standard cron schedule or use
shortcuts:

* `@daily` — Runs every day at midnight
* `@weekly` — Runs every Sunday at midnight
* Custom cron — e.g., `0 2 * * *` for 2 AM every day

**All jobs execute in UTC.** You can also run one-off syncs manually from the task dashboard.

<Info>
  To set up notifications for task completion or failures, configure them in **Notifications**.
</Info>

## Step 5: Monitor Replication

### Dashboard Monitoring

1. Go to **Tasks** and select your replication task
2. View:
   * **Last Execution**: When the sync last ran
   * **Status**: Success/In-progress/Failed
   * **Data Transferred**: Total bytes synced
   * **Execution Time**: How long the sync took

### View Detailed Logs

1. Click on an execution in the task history
2. View logs including:
   * Files synced/skipped
   * Any errors or warnings
   * Performance metrics

### Set Up Alerts

1. Navigate to **Notifications** in settings
2. Create a notification rule for your replication task
3. Choose channel: Email, Slack, or Webhook
4. Configure when to notify: On success, failure, or both

## Best Practices

### Performance Optimization

* **Filter by path**: If you only need to replicate specific directories, use path filters in your
  task configuration to reduce transfer time and costs
* **Schedule during off-peak hours**: Run large syncs at times when traffic is lowest
* **Use Daily or Weekly for large datasets**: Hourly syncs can be expensive if your data is large

### Cost Management

* **Railway Bucket egress is free**: Cross-region transfers between Railway Buckets don't incur
  egress charges

## Troubleshooting

### "Connection Failed" Error

**Cause**: Invalid S3 credentials or incorrect endpoint URL

**Solution**:

* Verify your Access Key ID and Secret Access Key are correct
* Confirm the Endpoint URL matches what's shown in Railway console (e.g.,
  `https://t3.storageapi.dev`)
* Ensure the bucket name is exact (Railway generates unique names with hashes)
* Test the connection again after updating credentials

### Slow Transfer Speed

**Cause**: Free tier accounts have limitations on transfer performance

**Solution**:

* Free tier transfers are **single-threaded with a 1 GB/s speed cap**. Upgrade to Pro for parallel
  transfers and faster speeds.
* Consider splitting large datasets into smaller sync jobs
* Run syncs during off-peak hours to avoid network congestion

## Next Steps

* Learn about [general task creation](/creating-tasks) for other use cases
* Explore [vault integration](/vault-integration) for managing credentials securely

## Additional Resources

* [Railway Documentation](https://docs.railway.com/storage-buckets)
