# 1-time MySQL leads table update/repair from CSV

**URL:** <https://forum.mautic.org/t/1-time-mysql-leads-table-update-repair-from-csv/25280>\
**Category:** Commercial\
**Tags:** opportunity\
**Created:** [September 3, 2022, 8:24am UTC](https://forum.mautic.org/t/1-time-mysql-leads-table-update-repair-from-csv/25280 "2022-09-03T08:24:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![entrepositive](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/entrepositive/32/9645_2.png) [@entrepositive](https://forum.mautic.org/u/entrepositive)\
**Post date:** [September 3, 2022, 8:24am UTC](https://forum.mautic.org/t/1-time-mysql-leads-table-update-repair-from-csv/25280/1 "2022-09-03T08:24:51Z")

</div>

**The opportunity is** :

I made a bad API call and it totally wrecked my leads table, with corrupted data that got split up over multiple columns - very messy. I recovered the data, fortunately, in a CSV file with ~3k contacts incl anon. I also have a backup of the live DB in its current state (with corrupted leads data), so we can run through this process as many times as we need.

I managed to get the leads table rebuilt from the CSV, but it’s not clean and not 100% correct. Front end in Mautic still showing (some, not all) data in the wrong columns, for example anon contacts aren’t recognized as anon by Mautic and their IPs appear under the “Name” column on Contacts page - but at least single data items aren’t split across multiple columns, so it still feels like progress.

Further, contact ids in Mautic are in the wrong column so viewing/editing contacts and their info is not possible, however they do show up correctly in the MySQL table correctly, which makes me think this there could be a PHP issue, or at least that I did something wrong in the process.

I am an absolute beginner in MySQL and DB mgmt so it’s most likely a mistake on my part. I’m hoping this could be a 15-minute issue for a Mautic/MySql expert and also hoping the entirety of the issue lies in MySql.

**Support issue topic** :

> [@Help! Mautic unusable - Contact data scrambled](https://forum.mautic.org/t/help-mautic-unusable-contact-data-scrambled/25158/14):
>
> Hi, I think the final price highly depends on the amount of data and database size, because the more data, more time is required. I can look into your database situation just not before next week. If you are interested drop me a PM with your email and I will contact you, when I have time to analyze the data and make an actual offer. But I do hope you manage to resolve the issue as soon as possible - with or without my help :). Regards, M.

**It is based in** :

Online, VPS, communication by Whatsapp/email.

**Remote OK**?: 100%

**Salary/remuneration** :

I will compensate fairly based on pre-negotiated terms after we calculate the scale of this job.

**To find our more** :

Please respond here in this thread.

Thank you,

EP

---

<div class="post-metadata">

**Author:** ![seth2398](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@seth2398](https://forum.mautic.org/u/seth2398)\
**Post date:** [September 5, 2022, 7:29am UTC](https://forum.mautic.org/t/1-time-mysql-leads-table-update-repair-from-csv/25280/2 "2022-09-05T07:29:22Z")

</div>

Hello,

Interested in your requirement.

Please reach me at Skype or Email.

Skype - cis.seth

Email - [seth@cisinlabs.com](mailto:seth@cisinlabs.com)

Thanks

Seth R

---

<div class="post-metadata">

**Author:** ![Andrew2](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/andrew2/32/561_2.png) [@Andrew2](https://forum.mautic.org/u/Andrew2)\
**Post date:** [September 6, 2022, 6:17pm UTC](https://forum.mautic.org/t/1-time-mysql-leads-table-update-repair-from-csv/25280/3 "2022-09-06T18:17:17Z")

</div>

Hi,  
What you are wanting done is well within my area of expertise and I would be glad to help you out.  
You can reach me on [andrewjohnson56782@gmail.com](mailto:andrewjohnson56782@gmail.com)  
Cheers and Have a great day ahead,  
Andrew

---

<div class="post-metadata">

**Author:** ![entrepositive](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/entrepositive/32/9645_2.png) [@entrepositive](https://forum.mautic.org/u/entrepositive)\
**Post date:** [September 6, 2022, 6:40pm UTC](https://forum.mautic.org/t/1-time-mysql-leads-table-update-repair-from-csv/25280/4 "2022-09-06T18:40:50Z")

</div>

Thank you guys, have emailed you both.
