---
title: "Hub/Sink Replication: Sink Task"
description: "Connect a RavenDB database as a replication sink in Studio to receive documents from a hub with certificate-based authentication."
url: "https://docs.ravendb.net/7.2/studio/database/tasks/ongoing-tasks/hub-sink-replication/replication-sink-task"
version: "7.2"
---

# Hub/Sink Replication: Sink Task

> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

## Hub/Sink Replication: Sink Task

> **Note**
>
> - A Replication Sink is an ongoing task, designed to replicate documents to and/or
>   from Hub tasks to maintain a live replica of a database or chosen documents of it.
>   - The Sink is always the one to initiate the connection with the Hub, but data can
>     be replicated in either or both directions.
>   - Hub/Sink connections are secure, and require [certification](https://docs.ravendb.net/7.2/studio/database/tasks/ongoing-tasks/hub-sink-replication/overview.md#accesses-and-certificates).
>
> - While defining a Sink task using the Studio, you can -
>   - Import a certificate issued by the Hubs that this SInk uses
>   - Choose replication direction/s (`Hub->Sink` / `Hub<-Sink` / `Hub<->Sink`)
>   - Use [Filtered Replication](https://docs.ravendb.net/7.2/studio/database/tasks/ongoing-tasks/hub-sink-replication/overview.md#filtered-replication) to choose which documents are to be replicated
>
> - In this page:
>   - [Create an Ongoing Replication Sink Task](#create-an-ongoing-replication-sink-task)
>   - [Import Configuration From Hub](#import-configuration-from-hub)
>   - [Sink Configuration](#sink-configuration)
>   - [Access Configuration](#access-configuration)
>   - [Definining Filtered Replication](#defining-filtered-replication)
>   - [Ongoing Tasks View](#ongoing-tasks-view)

## Create an Ongoing Replication Sink Task

![Figure 1. Create Database Task](https://docs.ravendb.net/assets/images/sink_create-database-task-7eb0daf1a3b42abb3fd7d0ddbcaacd98.png)

![Figure 2. Create a Replication Sink Task](https://docs.ravendb.net/assets/images/sink_choose-sink-task-23072bb60e3da24204d3fc8f134eb0b4.png)

## Import Configuration From Hub

![Figure 3. Import Configuration From Hub](https://docs.ravendb.net/assets/images/sink_import-configuration-from-hub-b6ac7a6140e3df754074ee9405f26899.png)

1. **Import configuration from Hub**
   - Click this button to browse the file system for a configuration
     file you have previously exported from the Hub task you want this
     Sink to connect.  
     Importing a configuration file would fill **Sink**, **Access**
     and **Filtering** fields you've filled while defining the Hub task,
     including certification details, and save you the effort of redefining
     them here.

## Sink Configuration

![Figure 4. New Replication Sink](https://docs.ravendb.net/assets/images/sink_new-replication-sink-20cf99926910ad4a59e29dd6e5b71e6f.png)

1. **Choose Database**
   - Choose the database that the task would replicate data for,  
     from a list of databases whose database-group includes this node.

2. **Save / Cancel**
   - **Save** to create or update the task
   - **Cancel** to dismiss any changes or cancel task creation

3. **Sink Task Name**
   - Choose a name for your Sink task

4. **Hub Task Name**
   - Enter the name of the Hub task this Sink is to connect with.

5. **Choose preferred mentor node manually**
   - Choose which node would run the Sink task by default,
     from a list of nodes running the database you chose.

6. **Allow replication from Hub to Sink**
   - Enable or Disable data replication from Hub to Sink.

7. **Allow replication from Sink to Hub**
   - Enable or Disable data replication from Sink to Hub.

8. **Create a new RavenDB connection string**  
   The connection string defines the path to the Hub task this Sink
   is to use.
   - **Disable** to select an existing connection string  
     ![Figure 5. Select a Connection String](https://docs.ravendb.net/assets/images/sink_select-connection-string-ad918973f7574d9463e17f9ca8604baa.png)  
     **`a`**. Click to select from a list of existing connection strings
   - **Enable** to create a new connection string  
     ![Figure 6. New Connection String](https://docs.ravendb.net/assets/images/sink_new-connection-string-7e6796e981bcd291583f8f6c278652e4.png)  
     **`a`**. Enter a connection string name that hasn't been used yet  
     **`b`**. Enter the name of the database running the Hub task  
     **`c`**. Enter URLs of nodes that may run the Hub task  
     **`d`**. Click to add the URL to the list  
     **`e`**. Remove URL  
     **`f`**. Verify that the URL is reachable  
     **`g`**. Reachable URLs will produce this affirmation

## Access Configuration

![Figure 7. New Replication Access](https://docs.ravendb.net/assets/images/sink_new-replication-access-ef54e1598921892b4f1235b023535387.png)

1. **Access Name**
   - Provide a name for this Sink access

2. **Certificate Source**  
   Choose a source for the Sink certificate.  
   ([Import Hub configuration](#import-configuration-from-hub)
   to save yourself the need to redefine these details.)
   - **Provide your own certificate**  
     Use this option to import a certificate of your own, e.g. one
     you've issued using the Hub task.  
     **`a`**. **Certificate File**  
     Use the Browse button to locate the exported certificate file.  
     **`b`**. **Certificate Passphrase**  
     If you need to provide a passphrase for your certificate, enter it here.
   - **Use the server certificate**  
     ![Figure 8. New Replication Access](https://docs.ravendb.net/assets/images/sink_use-server-certificate-e63bb222e092f56d4d44508d101a8432.png)
     Choose this option if you prefer to import and reuse the certificate
     that is already used by the server to validate client access.  
     The Studio will attempt to import it from the server. Use the
     **Download** button (**`a`**) if you need to locate it manually.

## Defining Filtered Replication

![Figure 9. Defining Filtered Replication](https://docs.ravendb.net/assets/images/sink_filtered-replication-584f774be280cf22fa4a96147b6b12bd.png)

1. **From Hub to Sink**
   - Enter each path you want the Hub to replicate to the Sink, in
     the `Enter documents prefix` text box.  
     Click the `Add Prefix` button to add it to the prefix list.
     - You can define a prefix that uses a wildcard (`*`).  
       Place the wildcard in the prefix' suffix, after `/` or `-`.  
       e.g. `products/*`
     - You can provide exact document IDs.

2. **Use above prefixes (Hub to Sink) for both directions**
   - **Enable** this option to allow replication of the same prefixes
     in both directions, Hub to Sink and Sink to Hub.  
     **Disable** it to provide an independent list of prefixes for
     Sink to Hub replication.

     > **Info**
     >
     > Note that only prefixes that are defined in **both** lists
     > will be replicated.

## Ongoing Tasks View

![Figure 10. Ongoing Tasks View Info](https://docs.ravendb.net/assets/images/sink_ongoing_tasks_view_info-81143765d7802948f50f446f386742db.png)

1. **Task Status**  
   Task status may be -
   - *Active*  
     Sink tasks turn active when replication actually takes place, after
     a document they replicate has changed.
   - *Not Active*
   - *Not on Node*  
     The task is not defined for this node.  
     To check this task's status, open the Ongoing Tasks view
     from a node the task belongs to.

2. **Responsible Node**  
   The node responsible for this task.

3. **Topology View**  
   Show the task and its responsible node in the database group topology.  
   ![Figure 11. Ongoing Tasks View Buttons](https://docs.ravendb.net/assets/images/sink_ongoing_tasks_view_buttons-c5a5884d5398c96013f5db0ad7abc40d.png)

4. **Enable/Disable task**

5. **Edit task**

6. **Delete task**

7. **Info button**  
   Click the Info button to show the following details:  
   ![Figure 12. Extended Info View](https://docs.ravendb.net/assets/images/sink_extended-info-049dbf7e8119b6e90469627bddaf61e9.png)
