How to Migrate Warehouse Destination from Segment to RudderStack

A step-by-step guide on migrating your warehouse destination from Segment to RudderStack.

This guide recommends the best practices for switching over your warehouse destinations from Segment to RudderStack.

RudderStack warehouse table schemas are compatible with Segment. You can start routing new events with RudderStack to your existing warehouse tables without losing any historical data.

Migrating Server-side sources

Since we can predictably upgrade all backend services, switching over server-side sources is simpler compared to client-side sources.

Step 1 - Create a Warehouse Destination in RudderStack

  • Create a new warehouse destination and set the namespace to be the same as the schema that Segment is writing. RudderStack will write to the same set of tables as Segment.

Step 2 - Route new events to RudderStack

  • Switch all the server-side clients to route data to RudderStack

  • Any events that are pending at Segment will be routed into your warehouse

  • RudderStack will start routing new events into your warehouse

  • If both Segment and RudderStack try to write to the same tables at the same time, it could result in Serializable isolation errors in some warehouses like Redshift. This is an intermittent issue and would succeed after retry.

Migrating Client-side sources

There could be clients which are still using the old version of your app (eg. Android/iOS) and sending events to Segment. Follow the below steps to easily migrate to RudderStack and storing the event data in the same tables as Segment.

Migrating Warehouse Destinations

Step 1 - Create a Warehouse Destination in RudderStack

  • Create a new warehouse destination and set the namespace to be the same as the schema that Segment is writing. RudderStack will write to the same set of tables as Segment.

Step 2 - Create a Segment Source in RudderStack

  • Create a new source of type Segment. This is to collect events from users who are still sending events to Segment.

  • Copy the webhook URL. Replace DATAPLANE_URL with your data plane URL.

Step 3 - Create a Webhook destination in Segment

  • Create a new webhook destination to the source where your warehouse is connected.

  • Configure the webhook URL in the webhook settings.

  • Once the sync intervals are configured, as mentioned in step 4, the webhook destination should be enabled.

Step 4 - Configure Warehouse sync interval in RudderStack

  • We want to capture all events in RudderStack and load them after the final switchover.

  • Configure RudderStack's warehouse destination such that it will start syncing after Segment's warehouse load completes.

  • Eg. If Segment is going to finish loading the latest batch at 10 PM, then RudderStack's warehouse loading should start after that (10.30 PM/11 PM/..).

  • If both Segment and RudderStack try to write to the same tables at the same time, it could result in Serializable isolation errors in some warehouses like Redshift. This is an intermittent issue and would succeed after retry.

Step 5 - Disable Warehouse Destination in Segment

  • Once the latest Segment's warehouse load is complete, we can disable Segment's warehouse destination. RudderStack will have the events from the webhook, they will be deduplicated when uploaded to the warehouse.

  • RudderStack will keep loading new events as per configured schedules.

Step 6 - Disable Webhook Destination in Segment

  • Once all clients are migrated over to RudderStack, you can disable the webhook destination in Segment.