Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore backups for organisations and users after a new setup #356

Closed
sebdeleze opened this issue Oct 19, 2020 · 2 comments · Fixed by #364
Closed

Restore backups for organisations and users after a new setup #356

sebdeleze opened this issue Oct 19, 2020 · 2 comments · Fixed by #364

Comments

@sebdeleze
Copy link
Contributor

No description provided.

@sebdeleze
Copy link
Contributor Author

For realizing this, I have to do this tasks:

  • Store files in a different location for each resource type, to be able to remove all file for a type of resource at once.
  • Separate DB tables for each resources type, to be able to truncate table for a specific type (this task might be complicated as I noticed a problem with invenio-records-files, the common metadata DB table is hard-coded).
  • Create a CLI to completely remove all records for a resource type (metadata and files).

Maybe the last bullet is not mandatory and I can do this each time by hand, by executing SQL commands. But I think it's more comfortable with a CLI.

Note: This steps will serve us only to the future deployments in TEST environment. In production, we cannot delete records and we will have to create migration's scripts if JSON schemas are modified.

@jma May we have you opinion on this process?

@sebdeleze
Copy link
Contributor Author

@mmo Could you give me the message to show in the front page, saying that data may be resetted?

sebdeleze pushed a commit that referenced this issue Nov 10, 2020
This PR aims to backup organisations and users data just before cleaning the database and restore them after.

* Moves organisations and users fixtures.
* Updates setup script to backup and restore data for organisations and users.
* Adds a method in API to get the record class corresponding to PID type.
* Adds a method in API to retrieve all PIDs for a given type.
* Adds a command to export records for all types.
* Adds a configuration to specify export serializers.
* Updates organisation's fixtures CLI to add files to records.
* Adds a marshmallow schema for exporting organisations and users.
* Removes password hashing when loading users fixtures as password is already hashed.
* Displays a message in frontpage saying that data might be deleted.
* Closes #356.

Co-Authored-by: Sébastien Délèze <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant