How to move mongodb database files from one server to another in Windows

Опубликовано: 13 Сентябрь 2021
на канале: Liv4IT
3,917
19

How to move mongodb database files from one server to another in Windows


Make sure that mongod doesn't run in the background. If it still runs, you can close it with ctrl + c.
Create a folder named dataBackup in c: drive (or any other location that you prefer)
Run this command in Windows PowerShell (Admin)
mongod --dbpath="c:\dataBackup"

Change the path to where you created your new data folder and make sure that you put the path inside the quote.

Exit mongod with ctrl + c

Copy/cut & paste existing data from data folder into the new dataBackup folder

Make sure that the mongod.lock file is empty. Otherwise, you can delete it. This won't damage anything and will be automatically regenerated when you run mongod. (When it's not empty, it will throw an error & mongod will automatically shut down.)

Your existing data now should have been moved and you can start to get your data stored in the new directory when you work with one.








🌸 Support channel & make donation :
https://www.paypal.me/aminenina/5

🌸 Subscribe for more videos :
Youtube:    / aminosninatos  

🌸 Follow me On Social Media
Facebook :   / aminosninatos  

***********************************************************************

🌸 How To Check Bad Blocks Or Bad Sectors On a Hard Disk In Linux
https://www.youtube.com/watch?v=jE-I9...

🌸 Linux How To Partition a Hard Drive Using the Parted Command
https://www.youtube.com/watch?v=2IoEW...

🌸 Checking or Repairing a File System using fsck in Linux
https://www.youtube.com/watch?v=CcV_M...

🌸 How To Monitor the Health of Your Hard Drive in Linux using SMART
https://www.youtube.com/watch?v=z1z9R...

🌸 Linux iotop: Monitor your disk Input/Output
https://www.youtube.com/watch?v=pWG4v...

🌸 How To use the “du” (Disk Usage) Command in Linux
https://www.youtube.com/watch?v=RA4bM...

🌸 How To View Manipulate System Logs In Linux Using Journalctl Command
   • How To View Manipulate System Logs In...  

🌸 How To Sync And Backup Files In Linux Using Rsync Command
   • How To Sync And Backup Files In Linux...  

🌸 Linux cURL Command Tips and Tricks
   • Linux cURL Command Tips and Tricks  

🌸 Linux tail and multitail commands
   • Linux tail and multitail commands  

🌸 Linux How To view Log Files
   • Linux How To view Log Files  

🌸 How To use the History Command On Linux
   • How To use the History Command On Linux  

🌸 Tips and Tricks How To manipulate Text Files on Linux
   • Tips and Tricks How To manipulate Tex...  

🌸 How to Archive, Compress and Extract Files Using the tar Command on Linux
   • How to Archive, Compress and Extract ...  

🌸 Linux - How to split larger files into smaller parts
   • Linux - How to split larger files int...  

🌸 Linux commands : Top
   • Linux commands : Top  

***********************************************************************
#Mongodb#Windows#Database