DEV Community

Ayu Adiati
Ayu Adiati

Posted on • Edited on

Move MongoDB Local Data to Another Hard Drive - Windows 10

My drive C: is lack of capacity. So I moved all of my projects and personal folders to drive D:.

Then I create a data folder with db as sub-folder in D: to store data.
I ran mongo command and saw that it creates new files in D:\data\db.
So I assume everything works(?)

I use Windows 10 & I have Googled this topic. The most coming back results of how to do this is using Linux while I don't know any Linux. The others are using MacOS and Mongo Atlas (but I don't use Mongo Atlas. I use MongoDB locally)

Can anybody help me on how to do this in Windows 10?
Would it be to simply cut & paste data from the data folder in MongoDB directory on drive C: to D:?

Most of my data are local. Only one project that I've deployed to Heroku.
And MongoDB is still installed on C:

Appreciate any help 🙏🏻

Top comments (0)