Hugo Nava Kopp
Hugo Nava Kopp

Reputation: 3064

How to migrate data between Couchbase servers?

I'm new to Couchbase. Does anyone know how to connect between Couchbase (CB) servers in order to migrate data? I want to migrate data from a production CB server to my local server.

I found here how to migrate between buckets, but within the same server.

Also, I could do the migration between different servers using a backend application (I'm using C#.Net) using N1QL, but I want to learn how to do the server to server migration since it is a pretty standard and common operation .

Many thanks in advance.

Upvotes: 1

Views: 1826

Answers (3)

Hugo Nava Kopp
Hugo Nava Kopp

Reputation: 3064

Thanks to @Ade Stringer who finally gave me the best solution, which is to use the cbtransfer tool. This tool simply needs the source and target urls of the servers (and the names of the buckets), which is ideal since -- in general-- one doesn't have access to the file system of the servers.

Here is a sample call:

cbtransfer http://10.10.10.68:8091 http://localhost:8091 -b SourceBucketName  --bucket-destination TargetBucketName

Note that the first parameter is the source CB server (http://10.10.10.68:8091) and the second one is the target CB server (http://localhost:8091). The value of the -b parameter is the name of the source bucket and the value of the --bucket-destination parameter is the name of the target bucket.

In order to run this command in Windows, you must first go to the following folder:

C:\Program Files\Couchbase\Server\bin\

If one prefers to use the cbbackupmgr and cbbackup tools which were mentioned in the other answers, one needs to have access to the file system, which in my case was not possible. But still both tools are also useful nevertheless and I appreciate their answers.

Upvotes: 1

jwon
jwon

Reputation: 21

Either cbbackup and/or cbrestore or just turning on XDCR to get the changes from production to your local server would work too.

Definitely some security implications on doing this, but that's up to you to figure out! :)

Upvotes: 2

avsej
avsej

Reputation: 3962

Do you need continuous migration? Or backup/restore would be enough?

If latter, you can use cbbackup/cbrestore tools http://developer.couchbase.com/documentation/server/current/backup-restore/backup-restore.html

Upvotes: 2

Related Questions