Skip to content

feat: add personal data export script#3353

Draft
carlinmack wants to merge 2 commits into
inveniosoftware:masterfrom
carlinmack:personal-data-export
Draft

feat: add personal data export script#3353
carlinmack wants to merge 2 commits into
inveniosoftware:masterfrom
carlinmack:personal-data-export

Conversation

@carlinmack

@carlinmack carlinmack commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

For inveniosoftware/product-rdm#240

This is a draft PR to share a script to create a data export of user data, relevant to GDPR in Europe or OC11 at CERN. It also is useful as an example of how to access different parts of InvenioRDM programmatically via the service methods

The output of the script has the following structure:

sitename-username-date/
            communities.yaml      # metadata for communities they are members of
            personal_data.yaml    # profile data, sessions, oauth, etc
            access-logs.yaml      # if relevant environment variables are set
            drafts/
                234567/
                    234568.yaml   # metadata
                    234568.zip    # files zipped
            records/
                123456/
                    123457.yaml   # metadata
                    123457.zip    # files zipped
            requests/
                # requests and all events that the user has access to
                2694d0a9-e656-4d40-aaf2-0c3519b27960.yaml

If this is to be used to provide an export for real users, the output must be checked to ensure that it contains the sufficient and necessary data relevant for your instance. For example, if you have custom fields or functionality, whether designed to be public or internal, you should ensure whether they are exposed or hidden correctly. As much as possible I have used the user_identity, however in some places the system_identity has had to be used, especially for exporting deleted records and communities.

Both yaml and json can be used for the output format, but we have chosen yaml as the default as it is more human readable.

There are some TODOs noted in the code for future work (mostly to do with getting more than 10k results from OpenSearch/ElasticSearch), and ideally this will be integrated: First into the admin panel, and then into the users settings page.

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

This PR was automatically marked as stale.

@github-actions github-actions Bot added the stale No activity for more than 60 days. label May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale No activity for more than 60 days.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants