Separate a database into two different business

Hi,

I have a database with 1000+ entries and growing, but the entries belongs to two different business (A and B), and I need to change the data structure of them. I need to have two separated databases with different data structures for each business.

I tried to make a copy of this database to have two identical copies. For business A, I just delete all entries of business B, and vice versa.

I could not find a way to make a copy of a database. I tried exporting and importing, but it did not work.

Is there a way to make a copy of a database in Fibery? or is there a better way to separate a database into two different business?

thanks a lot.

1 Like

Hi @Gregorio_Bueno :vulcan_salute:

I had a similar experience, I wanted to separate a database into two different DBs. I actually used the Fibery AI, I suggest to use a prompt like:

"On the database X I have a column called business, where I have two different business called business A and business B. Please create a new database called “Business A Records” and move all the business A entities from the Database X to the new one. Then create a DB called “Business B records) and populate them with the Business B entities from the X database.”

Be specific with your database and column names, that will help. For me worked great and made two new databases and I had the first one as a backup.

1 Like

Nice idea with the AI!

It’s hard to duplicate databases because it s generally bad practice.

If you have another business, you’ll need to make another database?

When building in Fibery I try to think about how to set things up that, as they grow, you don’t need to change the schema at all, just add rows and set relations.

Can I ask that in the data structure is different with the new business? Maybe there’s any other solution will scale better.

1 Like

Agree, I think maybe the structure needs to be different, I also suggest to take a look at your data and try to structure in a better way, might be better to relate between the DBs and be able to access to clean data structures.

I just had to do this because I imported a big CSV file with mixed data.

1 Like

Best solution from our side would be Split database action, like you click it, provide database name and some conditions what entities should be converted to this database automatically.

Right now what you can do is create this new database manually (main thing is to have all fields with the same names and types to not loose any data), go to table view of older database and batch convert entities to the new database.

1 Like

Hi Ron

”Can I ask that in the data structure is different with the new business? Maybe there’s any other solution will scale better."

The data structure is not so different, I could solve it by creating new columns. My main point is acccess permission, because I need only certain people accessing each database, but the main one is forms. I have few people filling these databases via forms. one column of this database is my projects, and I have many projects for each company.

when someone from company A is creating an entry via form, when they click on project, they can see all projects from company B. One way to solve it is to create two columns: one for Project A and other for Project B, but this is not scalable (maybe I’ll have company C and company D in the future :slight_smile: )

I’ve created a topic asking for a filter in forms, but Fibery does not have it. I think the only way to keep privacy for both business is separating the databases.

1 Like

I knew it! Hahah. Indeed this would be better to do via a one database and proper permission system.

In your case, are using the form views publicly or within the workspace?

If within the workspaces, there’s a lot more options around access and permissions.

If public, things get much trickier, because like you said, it shows all options in the dropdown…

There are new things coming to public sharing soon where you can set which Access Template to share an entity publicly with. I’m wondering if a use case like this could be taken into consideration…? Somehow sharing forms with access templates.

I think it would need a “Context Form” to work.
See here: Smart Folders: Add Form and Add form view in relation views in entity.

Then you could potentially share an entity with a form in the relation view, and that would allow people to create in that form, with only seeing the related entities to that entity.

CURRENT WORKAROUNDS:
I think the best of the best workaround would be:

  1. Invite them in as Guests into a client portal. In the client portal, they only have access to their project.
  2. Each project entity has a formula field to the same form BUT this is form is URL Encoded to contain “This Project” as a pre-filled hidden field.
  3. So to fill the form for a project, first they go into their client portal in Fibery, find the project, click the link to the form, then add it in (and it will auto attribute to the right project because of the URL encoding)

What you’ll need:

  1. Fibery for info on url encoding.
  2. What is the best way to get the ID of drop down options? - #6 by Chr1sG to autopopulate the UUID of projects into a field. (Plus vote for this feature if you don’t wanna rely on scripts: Get UUID from formula)

And I think the rest is straight forward.

Let me know if this could work!!

I know its far from your original request for help, but I think this is more scaleable than making new databases per business.

Sidenote: another potential Fibery Solution is allowing guests to create within the entity they were shared. I recall reading about it here: Access template allowing related entity creation - #4 by antoniokov and here Self Management of a Very Large Group.

Good luck!!

1 Like