# Migrating From PostgreSQL to MongoDB in a .NET EF Core Application

DevFeed: [Migrating From PostgreSQL to MongoDB in a .NET EF Core Application](<https://devfeed.tech/articles/migrating-from-postgresql-to-mongodb-in-a-net-ef-core-application-21837.md>)

Original publisher: [Read original article](<https://www.thepolyglotdeveloper.com/blog/2025/05/migrating-from-postgresql-to-mongodb-in-a-net-ef-core-application/>)

Author: Luce Carter

Published: 2025-05-01T12:00:00Z

Content type: tutorial

Language: en

Sources: [Nic Raboy](<https://devfeed.tech/sources/nic-raboy.md>)

Topics: [MongoDB](<https://devfeed.tech/topics/mongodb.md>), [efcore](<https://devfeed.tech/topics/efcore.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Database](<https://devfeed.tech/topics/database.md>), [software-development](<https://devfeed.tech/topics/software-development.md>), [.NET](<https://devfeed.tech/topics/net.md>)

Tags: [application](<https://devfeed.tech/tags/application.md>), [application-modernization](<https://devfeed.tech/tags/application-modernization.md>), [collections](<https://devfeed.tech/tags/collections.md>), [data-migration](<https://devfeed.tech/tags/data-migration.md>), [database](<https://devfeed.tech/tags/database.md>), [dotnet](<https://devfeed.tech/tags/dotnet.md>), [efcore](<https://devfeed.tech/tags/efcore.md>), [embedding](<https://devfeed.tech/tags/embedding.md>), [genai](<https://devfeed.tech/tags/genai.md>), [migrate](<https://devfeed.tech/tags/migrate.md>), [modernization](<https://devfeed.tech/tags/modernization.md>), [mongodb](<https://devfeed.tech/tags/mongodb.md>), [net](<https://devfeed.tech/tags/net.md>), [net-development](<https://devfeed.tech/tags/net-development.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [relational-databases](<https://devfeed.tech/tags/relational-databases.md>), [scalability](<https://devfeed.tech/tags/scalability.md>)

## AI overview

The tutorial outlines moving a .NET application from PostgreSQL to MongoDB while retaining EF Core through MongoDB's EF Core Provider, which became generally available in May 2024. It uses a simple application as its example and says MongoDB Relational Migrator was used to migrate the PostgreSQL data, applying recommendations to model collections around the principle that data accessed together should be stored together. The excerpt names seven source tables, including join tables for movie casts and genres, and notes that the migrated model takes advantage of MongoDB features such as embedded documents. It explicitly leaves the migration process itself to separate documentation and a demo video, so the excerpt does not provide the migration steps.

## Source excerpt

For many reasons--including scalability, flexibility, and modernization--more and more development teams are looking to migrate away from PostgreSQL to MongoDB. In the past, these teams might have been ... The post Migrating From PostgreSQL to MongoDB in a .NET EF Core Application appeared first on DEV.