# How to transfer data from mongoDB to elasticsearch using mongodb-plugin-input

**URL:** <https://discuss.elastic.co/t/how-to-transfer-data-from-mongodb-to-elasticsearch-using-mongodb-plugin-input/299001>\
**Category:** Logstash\
**Created:** [March 7, 2022, 6:21pm UTC](https://discuss.elastic.co/t/how-to-transfer-data-from-mongodb-to-elasticsearch-using-mongodb-plugin-input/299001 "2022-03-07T18:21:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Douglas\_Andrade](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/douglas_andrade/32/102707_2.png) [@Douglas\_Andrade](https://discuss.elastic.co/u/Douglas_Andrade)\
**Post date:** [March 7, 2022, 6:21pm UTC](https://discuss.elastic.co/t/how-to-transfer-data-from-mongodb-to-elasticsearch-using-mongodb-plugin-input/299001/1 "2022-03-07T18:21:38Z")

</div>

I would like to know if it is possible to transfer a complete database from mongoDB to Elasticsearch, not just new data, using mongoDB-plugin-input

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 7, 2022, 6:42pm UTC](https://discuss.elastic.co/t/how-to-transfer-data-from-mongodb-to-elasticsearch-using-mongodb-plugin-input/299001/2 "2022-03-07T18:42:35Z")

</div>

If the sincedb does not exist it will [find the first entry](https://github.com/phutchins/logstash-input-mongodb/blob/097cc9be8bb57754ec4006e174f0cb5cf3ff6b65/lib/logstash/inputs/mongodb.rb#L96) in the since\_column. Then it will fetch every item after that. So you should be able to transfer the complete database omitting only the first entry.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 4, 2022, 6:42pm UTC](https://discuss.elastic.co/t/how-to-transfer-data-from-mongodb-to-elasticsearch-using-mongodb-plugin-input/299001/3 "2022-04-04T18:42:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
