Replicate existing cluster's documents in new cluster - getting error: "Bash cbimport command not found"

replica

#1

I created a new cluster. Now I want to import my existing cluster’s buckets along with all the documents in my new cluster.

I tried taking export for each of the bucket from the existing cluster and then importing it. But while importing, I got an error “Bash cbimport command not found”.

Even I tried using cbdocloader but got the same error.

Please suggest what I need to do to replicate the existing cluster’s bucket details into new cluster.


#2

Hi @esita.banerjee, you’re on Mac, correct? Is it a simple path issue? E.g. does /Applications/Couchbase\ Server.app/Contents/Resources/couchbase-core/bin/cbimport work for you?


#3

No I am not on Mac. And the path for cbimport is /opt/couchbase/bin.

I have checked already that cbimport command is present in this folder.


#4

My mistake, I thought from another post you were on Mac. Still, this seems to be a simple path issue, unless I’m overlooking something (and apologies if I am)? E.g. is /opt/couchbase/bin in your path? Does running /opt/couchbase/bin/cbimport work?


#5

@graham.pople : No /opt/couchbase/bin/cbimport doesnot works. I am getting an error: “No such file or directory”.


#6

@esita.banerjee thank you for confirming. I’m confused then… Could you please post the output of ls -latr /opt/couchbase/bin/cbi*? I just want to confirm that the files look valid, have the executable flag, etc.


#7

@graham.pople : Please fimd the screenshot for the output of "ls -latr /opt/couchbase/bin/cbi"


#8

Thanks for sending that through @esita.banerjee. Just so I can see the error myself, and make sure we’re covering all bases, could you possibly send a screenshot of you running /opt/couchbase/bin/cbimport and the result please?


#9

@graham.pople :Please find the screenshot:

Can u please let me know what is the error?


#10

@esita.banerjee well there’s no error here, and the command is running successfully and printing the help message as you’ve not provided any of the required arguments. You need to tell it what data to import, please see https://developer.couchbase.com/documentation/server/current/tools/cbimport.html for more info.


#11

@graham.pople : I tried with this command but got the error: bash cbimport: command not found.

command : cbimport json --cluster http://localhost:8091 --bucket ChecklistLibrary --dataset file:///home/adcv2/Desktop/bucketLibrary/ChecklistLibrary.json --format lines --username Administrator --password Pwcwelcome1 --generate-key %metaid% --log-file /opt/couchbase/bin/import.log


#12

@esita.banerjee try that command but with /opt/couchbase/bin/cbimport instead :slight_smile:


#13

@graham.pople : Thanks a lot. This works. Was stuck in this issue for so long time… thanks a lot. But I have a question as why I need to provide /opt/couchbase/bin/ along with cbimport command?


#14

@esita.banerjee fantastic, I’m glad you’re past it. It’s just how paths and commands work on Linux, I recommend a Google for that one :slight_smile: All the best.


#15

@graham.pople Thanks a lot.


-bash: cbdocloader: command not found