Skip to content

How to Generate Entities from an Existing Database

Warning: You are browsing the documentation for Symfony 7.0, which is no longer maintained.

Read the updated version of this page for Symfony 7.1 (the current stable version).

Caution

The doctrine:mapping:import command used to generate Doctrine entities from existing databases was deprecated by Doctrine in 2019 and there's no replacement for it.

Instead, you can use the make:entity command from Symfony Maker Bundle to help you generate the code of your Doctrine entities. This command requires manual supervision because it doesn't generate entities from existing databases.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.
TOC
    Version