0

I need to copy a collection (large data size, around 100 GB) from one database server to another server. Also both server follows two different mongodb versions.

source server - lower mongodb version

destination server - latest mongodb version

Is there any best and faster way to make it done?

Thanks in advance.

arbitrary_A
  • 333
  • 3
  • 9
  • 2
    You can use `mongodump ... | mongorestore ...`, see https://stackoverflow.com/questions/11554762/how-to-copy-a-collection-from-one-database-to-another-in-mongodb/67077465#67077465 – Wernfried Domscheit Jan 04 '23 at 15:39
  • @WernfriedDomscheit I followed that, but its taking hours and hours to copy large collection. – arbitrary_A Jan 04 '23 at 15:44
  • I don't think there are any alternatives. You could try to copy all files from `dbPath` (while source and destination mongoDB are stopped) and then follow the [upgrade procedure](https://www.mongodb.com/docs/manual/release-notes/6.0-upgrade-standalone/) – Wernfried Domscheit Jan 04 '23 at 15:50

0 Answers0