path - Cannot change database directory of MongoDb -


i want change directory of mongodb. tried using mongod --dbpath , changing path of directory in mongod.conf. follwing commands used -

mongod --dbpath /home/mongodata

and

dbpath = /home/mongodata in /etc/mongod.conf

chown $user -r /home/mongodata

but when import data database, still goes /var/lib/mongodb folder. please can suggest how can change default directory of mongodb database?

i use ubuntu 14.04 , mongodb vz 3.0.6.

did stop , restart service. have answered now, others, put following. can modify below code specific needs. hope helps.

sudo service mongod stop sudo mv mongodb /home/mongodata sudo ln -s /home/mongodata /your-former-path sudo chown mongodb:mongoldb /home/mongodata sudo service mongod start 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -