Should we allow group administrators to import/export data for their group?
If so:
- is there anything too private that should not be exported?
- what about invites or notifications? do we need them in an export?
- are "activities", "activity_log", "documents" tables still in use ?
Answering to myself:
> 1. is there anything too private that should not be exported?
For the `users` table, I tend to keep only usernames. Drop email and encrypted password. And location. Paranoid?
It depends on the use case. Imho, users should trust group admins, those are friends helping a group for technical stuff. This can be technically discussed.
However they must trust server admin and hosting company (no choice but trust in this case), since they have access to the raw data.
I have 2 use cases in mind:
Some users can be paranoid. Given what happens ordinarily on the net, that is legitimate.
I would give the same data in the backup as the user is allowed to see.
Which means a group admin can see emails but not passwords of course
Passwords :
Technically, my proposal could be :
1) rebuild objects
2) with the help of table indexes, check if group exists in DB, same for users ; if they exist, print some information and terminate ; if they don't exist already, insert them and retrieve their IDs
3) insert actions, discussions, files4) check tags, create them if necessary (colors?), finally insert taggable_taggables
Note that this feature is already almost implemented as an artisan command. You can look in the code.
What is missing is tests, and ability to do it from the web UI instead of the command line.
If you could review this unfinished code it would be great.
or to CSV: more readable format, better for the user
When migrating a group to a new server, I would:
It looks complicated, but it is safe and realistic.
within admin dropdown in views/partials/tabs/groups.blade.php ?
yes
Fyi: I've done something in this branch: https://codeberg.org/zerline/agorakit/src/branch/export
(mirrored, with a few hours delay, on https://github.com/zerline/agorakit/tree/export)
I've kept your JSON strategy for now.
I'd prefer to have a new ExportService (with the related ImportService) or something like that instead of bloating the group model with even more code.
Done.
Note: I created a temporary storage (Storage::disk('tmp')). And I just pushed some code to cleanup that storage every hour.