# Multicompany in one DB

**URL:** <https://www.epiusers.help/t/multicompany-in-one-db/36175>\
**Category:** Epicor ERP 10\
**Created:** [November 10, 2016, 12:08am UTC](https://www.epiusers.help/t/multicompany-in-one-db/36175 "2016-11-10T00:08:55Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/3ec8ea/32.png) [@Daniel](https://www.epiusers.help/u/Daniel)\
**Post date:** [November 10, 2016, 12:08am UTC](https://www.epiusers.help/t/multicompany-in-one-db/36175/1 "2016-11-10T00:08:55Z")

</div>

We have what we believe is a common set up: more than one company stored in the same SQL database in E10. The question is how we can backup / restore just one company in case that something goes wrong with one of them without affecting the other two? Are there any tools either from EPICOR or a 3rd party utility that can help with this scenario?

Regards,  
Daniel Dell’Aquila

---

<div class="post-metadata">

**Author:** ![Manasa](https://www.epiusers.help/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@Manasa](https://www.epiusers.help/u/Manasa)\
**Post date:** [November 10, 2016, 1:31pm UTC](https://www.epiusers.help/t/multicompany-in-one-db/36175/2 "2016-11-10T13:31:58Z")

</div>

Uh, no…but curious why you feel the need to? I ask because there may be other tools to consider……

M. Manasa Reddy  
P: 703.471.7145 x454  
[manasa@euclidsys.com](mailto:manasa@euclidsys.com)[mailto:manasa@euclidsys.com](mailto:manasa@euclidsys.com)

---

<div class="post-metadata">

**Author:** ![John\_Mitchell](https://www.epiusers.help/user_avatar/www.epiusers.help/john_mitchell/32/718_2.png) [@John\_Mitchell](https://www.epiusers.help/u/John_Mitchell)\
**Post date:** [November 10, 2016, 1:45pm UTC](https://www.epiusers.help/t/multicompany-in-one-db/36175/3 "2016-11-10T13:45:00Z")

</div>

This would be hugely beneficial and would allow migrating and removing a single company. I would assume that the Epicor SAAS team has something to do this. @Bart_Elia any ideas?

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [November 10, 2016, 1:56pm UTC](https://www.epiusers.help/t/multicompany-in-one-db/36175/4 "2016-11-10T13:56:47Z")

</div>

I don’t think you can do this… at least not easily… every table in Epicor is littered with company specific information, you’d have to write a backup script that queried each individual table where CompanyID=X… and even restoring that back would be a nightmare you’d have to do inserts into each table… I don’t think there is any solution for this out there… Unless epicor wrote a specific set of scripts for this

---

<div class="post-metadata">

**Author:** ![amaragni](https://www.epiusers.help/user_avatar/www.epiusers.help/amaragni/32/5766_2.png) [@amaragni](https://www.epiusers.help/u/amaragni)\
**Post date:** [November 10, 2016, 2:13pm UTC](https://www.epiusers.help/t/multicompany-in-one-db/36175/5 "2016-11-10T14:13:56Z")

</div>

Right the need would be to automate the script process so that EACH and EVERY table in the DB - including IM tables, i suppose - would need to be polled, filtered/cleared of ALL entries with COMPANY = X, and then filled/inserted with ALL entries with COMPANY = X - from an active separate restored DB.  
i’ve never seen anything like this done before.

So theoretically, it IS possible. But a technical challenge to say the least.

---

<div class="post-metadata">

**Author:** ![Bart\_Elia](https://www.epiusers.help/user_avatar/www.epiusers.help/bart_elia/32/38379_2.png) [@Bart\_Elia](https://www.epiusers.help/u/Bart_Elia)\
**Post date:** [November 10, 2016, 2:16pm UTC](https://www.epiusers.help/t/multicompany-in-one-db/36175/6 "2016-11-10T14:16:54Z")

</div>

We do have an internal tool for this in SaaS we have been working on but you quickly run into what jose mentioned - tables not tied to a company (or tenant).

If your have been paying attention to the past few releases we are adding more ‘Company Visibility’ columns and ui widgets to manage those scenarios as we try to tease apart the proper ownership of an item

---

<div class="post-metadata">

**Author:** ![John\_Mitchell](https://www.epiusers.help/user_avatar/www.epiusers.help/john_mitchell/32/718_2.png) [@John\_Mitchell](https://www.epiusers.help/u/John_Mitchell)\
**Post date:** [November 10, 2016, 3:12pm UTC](https://www.epiusers.help/t/multicompany-in-one-db/36175/7 "2016-11-10T15:12:36Z")

</div>

How does SAAS remove customer data after they stop paying?

+1 for multitenancy on your priority list.

---

<div class="post-metadata">

**Author:** ![Bart\_Elia](https://www.epiusers.help/user_avatar/www.epiusers.help/bart_elia/32/38379_2.png) [@Bart\_Elia](https://www.epiusers.help/u/Bart_Elia)\
**Post date:** [November 10, 2016, 3:33pm UTC](https://www.epiusers.help/t/multicompany-in-one-db/36175/8 "2016-11-10T15:33:14Z")

</div>

Honestly don’t know. I’ll have to pester our ops folks the next time they need a favor 😉

---

<div class="post-metadata">

**Author:** ![John\_Mitchell](https://www.epiusers.help/user_avatar/www.epiusers.help/john_mitchell/32/718_2.png) [@John\_Mitchell](https://www.epiusers.help/u/John_Mitchell)\
**Post date:** [November 10, 2016, 3:59pm UTC](https://www.epiusers.help/t/multicompany-in-one-db/36175/9 "2016-11-10T15:59:25Z")

</div>

I would love to hear a talk on how they manage it and the lessons learned, especially with scaling and monitoring.

---

<div class="post-metadata">

**Author:** ![Daniel](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/3ec8ea/32.png) [@Daniel](https://www.epiusers.help/u/Daniel)\
**Post date:** [November 10, 2016, 6:04pm UTC](https://www.epiusers.help/t/multicompany-in-one-db/36175/10 "2016-11-10T18:04:21Z")

</div>

Today, I have told about RedGate SQL Compare as the tool that could possibly do this: I can load a SQL Backup file to the SQL Compare Program and point it to the LIVE Epicor Database and instruct SQL Compare to show the differences between the Backup and LIVE where the Company = the Company I am trying to restore. SQL Compare then creates a script file to run on your Live Database to make it match your Backup with the Company filter.

Has anyone tried this tool? Would Epicor frown upon this idea?

Here is the link: [SQL Compare: Compare And Synchronize SQL Server Schemas](http://www.red-gate.com/products/sql-development/sql-compare/?gclid=CKjR2vyxntACFQiQaQodC90F2w)

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [November 10, 2016, 6:13pm UTC](https://www.epiusers.help/t/multicompany-in-one-db/36175/11 "2016-11-10T18:13:56Z")

</div>

I’d wager good money that Epicor would pop a vein if you did this

---

<div class="post-metadata">

**Author:** ![John\_Mitchell](https://www.epiusers.help/user_avatar/www.epiusers.help/john_mitchell/32/718_2.png) [@John\_Mitchell](https://www.epiusers.help/u/John_Mitchell)\
**Post date:** [November 10, 2016, 8:36pm UTC](https://www.epiusers.help/t/multicompany-in-one-db/36175/12 "2016-11-10T20:36:35Z")

</div>

It looks like Data Compare does what you are talking about.

> **[SQL Data Compare: Compare And Synchronize SQL Server Database Contents](https://www.red-gate.com/products/sql-development/sql-data-compare/)**
>
> Use Redgate SQL Data Compare to compare and synchronize static, lookup, and reference data in your SQL Server database - try it free

Epicor has to be using a tool like this for their SAAS database.
