blindsidenetworks / scalelite

Scalable load balancer for BigBlueButton.
GNU Affero General Public License v3.0
469 stars 247 forks source link

Multitenancy: Migration path for recordings of existing (regular) Scalelite instance to a new tenant #938

Closed Ithanil closed 1 year ago

Ithanil commented 1 year ago

Problem to solve:

If multitenancy is enabled on an existing Scalelite deployment and configured in a way that a new tenant takes over the previous Scalelite URL and secrets 1:1, the corresponding frontends do not need to be reconfigured. Everything works as it did before the change, except for that the recordings are not available anymore.

Purposed solution:

Provide or document a migration path to transfer the existing recordings to the replacing tenant. Ideally, also provide a way to transfer the recordings from different Scalelites to further new tenants.

Considered alternatives:

Users lose all their recordings. Not ideal!

Additional context:

We are looking to replace multiple (at least 2) separate Scalelite deployments by one Scalelite with multi-tenancy enabled. We want to avoid losing the recordings (which are, by the way, disabled for one of the instances (for schools) and we need to be able keep it that way when using multitenancy!).

farhatahmad commented 1 year ago

Hmm this is a good point. I'm debating whether this should be done through a rake task or manually through the console

First, get the tenant-id for the tenant that you want to move the recordings to:

docker exec -it scalelite-api /bin/bash
./bin/rake tenants

Then, we can update the recordings metadata:

./bin/rails c

Recording.all.each do |rec| 
  next if rec.metadata.exists?(key: 'tenant-id')
  Metadatum.create(recording_id: rec.id, key: 'tenant-id', value: '<TENANT_ID>')
end
Ithanil commented 1 year ago

Thanks for the reply, but I won't be able to try this out until next Monday. I will report back then.