This question has already been answered:

Symfony 3. The project uses the main database. There is a task: to take data from the main database, process it and put it in several other databases. How to configure the application so that you can quickly switch between different databases?

Reported as a duplicate by Dmitriy Simushev , Community Spirit ♦ Jan 20 '17 at 5:55 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

1 answer 1

It is necessary to use different EntityManagers. Their configuration and usage example are described in the answer to the question “Connecting to the database in the Symfony 3 controller”.