Closed micbar closed 5 years ago
cc @IljaN
After discussing this with @micbar I have a few notes:
[ ] In order to make im- and export more robust, I thinks we should use multiple, jsonline files for the metadata:
.jsonl
as the extension as well as compression, eg .jsonl.gz
or .jsonl.bz2
[ ] For in place migrations we need an option to only write the metadata DO NOT COPY FILES!!
/tmp/export/
├── instance
│ ├── groups.jsonl
│ ├── instance.json
│ └── roles.jsonl
└── users
├── admin
│ ├── files
│ │ └── welcome.txt
│ ├── comments.jsonl
│ ├── files.jsonl
│ ├── properties.jsonl
│ ├── shares.jsonl
│ ├── tags.jsonl
│ └── user.json
├── User1
│ ├── comments.jsonl
│ ├── files.jsonl
│ ├── properties.jsonl
│ ├── shares.jsonl
│ ├── tags.jsonl
│ └── user.json
└── User2
├── files
│ ├── Folder
│ │ ├── Subfolder
│ │ │ ├── Screenshot_2019-03-28\ Settings\ -\ ownCloud.png
│ │ │ └── config_report_20190326.json
│ │ └── version-log.txt
│ └── welcome.txt
├── comments.jsonl
├── files.jsonl
├── properties.jsonl
├── shares.jsonl
├── tags.jsonl
└── user.json
Some data is needed only once:
instance.json
describes the instance itself and contains eg the secret and instanceidgroups.jsonl
roles.jsonl
that defines the mapping between roles and owncloud permissionsEvery user gets his own folder with:
user.json
per user
files.jsonl
- each line representing a metadata entry for a file
shares.jsonl
comments.jsonl
, tags.jsonl
and properties.jsonl
and maybe other jsonl files?import-<ISO8601date>
folder that should describe the results.
shares-failed.jsonl
what about guests?
what about versions / trash
Regarding permissions @pmaier1 correctly objected that we shouldn't store them as "owner","viewer","editor",... because these are abstractions consisting of multiple primitive permissions i.e (edit,view,delete...). There is also the type "custom" which can consist of any permissions combination. So the only approach here is to work with the lower-level primitive permission.
Need also to create a matrix how the new perms map to the old ones.
closing as the new format PR has been merged. The current export looks like this:
.
└── einstein
├── files
│ └── files
│ ├── Documents
│ │ └── Example.odt
│ ├── Photos
│ │ ├── Paris.jpg
│ │ ├── San\ Francisco.jpg
│ │ └── Squirrel.jpg
│ └── ownCloud\ Manual.pdf
├── files.jsonl
├── shares.jsonl
└── user.json
cat einstein/files.jsonl
{"type":"folder","path":"\/files","eTag":"5d9c925ed57b6","permissions":31,"mtime":1570542174}
{"type":"folder","path":"\/files\/Documents","eTag":"5d9c8e41a5ee2","permissions":31,"mtime":1570541121}
{"type":"file","path":"\/files\/Documents\/Example.odt","eTag":"8c883978b40a0119cded0d98f9f9f7f4","permissions":27,"mtime":1570541121}
{"type":"folder","path":"\/files\/Photos","eTag":"5d9c8e41efd41","permissions":31,"mtime":1570541121}
{"type":"file","path":"\/files\/Photos\/Paris.jpg","eTag":"b4071f830567be27c6806e3fe6afc2ab","permissions":27,"mtime":1570541121}
{"type":"file","path":"\/files\/Photos\/San Francisco.jpg","eTag":"2c3abec14b68a71899b21168ef86ec7b","permissions":27,"mtime":1570541121}
{"type":"file","path":"\/files\/Photos\/Squirrel.jpg","eTag":"fec2104bfc64bf7366822902fb66a2be","permissions":27,"mtime":1570541122}
...
{"type":"folder","path":"\/files\/core-10.3.0RC1","eTag":"5d9c925ed57b6","permissions":31,"mtime":1570542174}
...
{"type":"file","path":"\/files\/ownCloud Manual.pdf","eTag":"1038edfe0158e3899ed5079952210bcb","permissions":27,"mtime":1570541122}
cat einstein/shares.jsonl | jq
{
"path": "/core-10.3.0RC1",
"shareType": "user",
"owner": "einstein",
"sharedBy": "einstein",
"sharedWith": "marie",
"permissions": 31,
"expirationDate": null,
"password": null,
"name": null,
"token": null
}
cat einstein/user.json | jq
{
"date": "2019-10-08T19:34:55+00:00",
"originServer": "http://localhost/",
"user": {
"userId": "einstein",
"displayName": "Albert Einstein",
"email": "einstein@example.org",
"passwordHash": "1|$2y$10$SpvL5K/1.zevs/sleDYk/udThqy2/o9WTL1N8zFLcfGrLpujmqtw2",
"quota": "default",
"backend": "Database",
"enabled": true,
"groups": [
"physics-lovers",
"sailing-lovers",
"violin-haters"
],
"preferences": [
{
"appId": "core",
"configKey": "timezone",
"configValue": "Europe/Berlin"
},
{
"appId": "firstrunwizard",
"configKey": "show",
"configValue": "0"
}
]
}
}
Only thing I noticed: get rid of the /files
prefix for all files in files.jsonl. That way the path in shares.jsonl matches the one found in files.jsonl. Tracked in https://github.com/owncloud/data_exporter/issues/111
:rocket:
create new issues for data format issues.
Extend the current Data Format to meet new requirements
Requirements
Directory Structure
Metadata
metadata.json
in every export folder like the followingUser
etag
andpermission
Value could be empty to create a metadata.json for external storage or files without user context (ACLs, future OC)Instance Data
instancedata.json
in the root export folder