# Swap Mautic database tables

**URL:** <https://forum.mautic.org/t/swap-mautic-database-tables/31111>\
**Category:** Product Support\
**Created:** [February 29, 2024, 6:48pm UTC](https://forum.mautic.org/t/swap-mautic-database-tables/31111 "2024-02-29T18:48:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![iurijorbenadze](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iurijorbenadze/32/12738_2.png) [@iurijorbenadze](https://forum.mautic.org/u/iurijorbenadze)\
**Post date:** [February 29, 2024, 6:48pm UTC](https://forum.mautic.org/t/swap-mautic-database-tables/31111/1 "2024-02-29T18:48:14Z")

</div>

My Mautic version is: 4.4.4 (suggestiond with 5.0+ are accepted too)

Hello, I would like to know where is located Mautic code which is responsible for importing data (Import from background option on contacts page to be specific) into leads datatable (Mautic database, leads table which is responsible for holding contacts information).

To put this simply I would like to know where should I look for code which is executed after contacts are about to be imported. (I am aware that cron job mautic:import is also taking part in this so I would like to find any related code which is executed either by this cron job or directly after import).

Final goal is to swap leads table with custom\_leads table and import data into custom\_leads table. But to make sure all campaigns and contacts related logic is still tied to leads table, meaning if I decide to move data from custom\_leads table into leads table, only data present in leads table will be interacted with in Mautic.

---

<div class="post-metadata">

**Author:** ![iurijorbenadze](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iurijorbenadze/32/12738_2.png) [@iurijorbenadze](https://forum.mautic.org/u/iurijorbenadze)\
**Post date:** [March 1, 2024, 10:05am UTC](https://forum.mautic.org/t/swap-mautic-database-tables/31111/2 "2024-03-01T10:05:11Z")

</div>

@joeyk Any thoughts on this?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 1, 2024, 10:29am UTC](https://forum.mautic.org/t/swap-mautic-database-tables/31111/3 "2024-03-01T10:29:38Z")

</div>

I guess somewhere in contact bundle.  
This is giving you more clue:

> <https://github.com/mautic/mautic/blob/4a3cfb7c16c0551490cc598508d935cc3b31969d/app/bundles/LeadBundle/Command/ImportCommand.php>

---

<div class="post-metadata">

**Author:** ![iurijorbenadze](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iurijorbenadze/32/12738_2.png) [@iurijorbenadze](https://forum.mautic.org/u/iurijorbenadze)\
**Post date:** [March 7, 2024, 8:44pm UTC](https://forum.mautic.org/t/swap-mautic-database-tables/31111/4 "2024-03-07T20:44:32Z")

</div>

Thanks for the tip.  
@joeyk in this file: [mautic/app/bundles/LeadBundle/Model/ImportModel.php at 4a3cfb7c16c0551490cc598508d935cc3b31969d · mautic/mautic · GitHub](https://github.com/mautic/mautic/blob/4a3cfb7c16c0551490cc598508d935cc3b31969d/app/bundles/LeadBundle/Model/ImportModel.php)

I got to the line:  
“”"

```auto
$event = new ImportProcessEvent($import, $eventLog, $data);

$this->dispatcher->dispatch($event, LeadEvents::IMPORT_ON_PROCESS);

```

“”"  
**So regarding this any idea which listener is responsible for continuing import logic following from this part of code?**

My final goal is to locate code which is responsible for importing contacts into leads table, also in future will need same for lead\_lists\_leads table.

So I would like to know where import code says to import into leads table.
