MongoDB Backup to CSV Converter

A .NET console tool designed to convert MongoDB backups into CSV files automatically using Docker and MongoDB Database Tools.


Overview

MongoDB Backup to CSV Converter is a utility that converts MongoDB backup files into CSV format automatically.

The application spins up a temporary MongoDB instance using Docker, restores the provided backup file and exports all collections into CSV files using the mongoexport tool.

After the process is completed, the temporary container and associated Docker volume are automatically removed.


Features

  • Restore MongoDB backups automatically
  • Export collections to CSV files
  • Supports multiple backup formats
  • Temporary MongoDB environment using Docker
  • Automatic cleanup of containers and volumes
  • Interactive command-line interface

Supported Formats

  • .archive.gz — compressed MongoDB backup
  • .json — collection dump
  • .bson — binary MongoDB dump format

Requirements

  • .NET 8.0 SDK
  • Docker installed and running
  • MongoDB Database Tools (for mongoexport)

Example Usage


MongoDB to CSV Exporter
1. Configure Server – Docker
2. Restore backup from archive.gz
3. Restore backup from collection folder (*.json, *.bson)
4. Exit

After selecting an option, the application restores the backup, exports all collections to CSV and saves the results locally.


Technologies

  • .NET 8
  • Docker
  • MongoDB
  • MongoDB Database Tools
  • Command-line interface

License

This project is licensed under the MIT License.