deltanet / adapt_authoring

Source code for the Adapt Authoring tool
GNU General Public License v3.0
0 stars 1 forks source link

Question: What steps would be needed to import a database as a new tenant in a multi tenancy setup? #334

Closed dancgray closed 5 years ago

dancgray commented 5 years ago

Transferring single instance tenants to a multi tenancy environment will be a challenging task. One option would be to import the database and run a transformation script in MongoDB. The following tasks may be required:

  1. Restored single tenancy database to MongoDB

  2. Update _tenantId in the following tables: articles blocks contentObjects courses tags

  3. Update createdBy objectId in the following tables: articles assets blocks components contentObjects courseassets courses tags

  4. Update _componentTypeId in the following tables matched to the mapped _componentTypeId components

  5. Update _contentTypeId in assets with the mapped plugin Id ?

  6. Update _enabledExtensions in the configs collection with ObjectId of the mapped extensions

  7. Drop the following collections that are not required for a tenancy: clipboards componenttypes extensiontypes menutypes policies roles sessions tenants themetypes userpasswordresets users

  8. Rename the database with new tenant ObjectId

dancgray commented 5 years ago

Shelved as being edge case requirement.