jimishio / couchdb-to-mongodb Goto Github PK
View Code? Open in Web Editor NEWThis repository consists of scripts which can help migrating data from your couchdb databases to mongodb collections
This repository consists of scripts which can help migrating data from your couchdb databases to mongodb collections
@jimishio I tried running the shell file directly and it keeps throwing error.
I used a newer npm package cloudant couchbackup instead of the deprecated couchbackup on the readme file.
The error I received was
2018-09-25T14:51:37.569+0700 Failed: error processing document #2: invalid character '{' in literal new or null (expecting 'e' or 'u')
The solution I propose is by changing the mongoimport
command within the shell file to:
master_script.sh
#./master_script.sh collection_name mongo_db_name mongo_username mongo_password mongo_host mongo_port
couchbackup --db $1 > 1.json
# ./couch_to_mongo.sh 1.json
mongoimport --host $5 --port $6 --db $2 -u $3 -p $4 --collection $1 --drop --file 1.json --jsonArray --type json
rm *.json
and
master_script_without_pwd.sh
# ./master_script_without_pwd.sh collection_name mongo_db_name mongo_host mongo_port
couchbackup --db $1 > 1.json
# ./couch_to_mongo.sh 1.json
mongoimport --host $3 --port $4 --db $2 --collection $1 --drop --file 1.json --jsonArray --type json
rm *.json
Because we are passing the --jsonArray
flag, there is no need to change the [
,]
, and },{
strings with the sed
command.
Running @cloudant/couchbackup returns a list of revisions in the document if you run it without --mode shallow. The old couchbackup npm package has been deprecated.
As IBM Cloudant is also based on CouchDB, how IBM cloudant databases can be transferred to different collections of a single database or multiple databases.
Cloudant only gives maximum 200 documents per query.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.