mirror of
https://github.com/ciur/papermerge.git
synced 2026-04-25 12:05:58 +03:00
[PR #33] [MERGED] WIP: Implementing backup and restore feature #534
Labels
No labels
2.1
3.0
3.0.1
3.0.2
3.0.3
3.0.3
3.1
3.2
3.2
3.3
3.5
3.x
Fixed. Waiting for feedback.
Fixed. Waiting for feedback.
UX
Version 2.1 - alpha
XSS
announcement
beta
blocker
bug
cannot reproduce
confirmed
confirmed
critical
demo
dependencies
deployment
detchnical debt
discussion
docker
documentation
donations
duplicate
enhancement
feature request
frontend
fundraising
good first issue
good issue
help wanted
high
implemented
important
improvement
incomplete
invalid
investigation
kubernetes
low
low impact
medium
medium
medium impact
migration from 2.0
migration from 2.1
missing-language
missing-ocr-language
no-activity
note
ocr
outofscope
packaging
performance
popular request
pull-request
pypi
question
raspberry pi
roadmap
search
security
setup
status
task
technical debt
updates
user xp
version 1.4.0 - demo
will be implemented
will not be implemented
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/papermerge#534
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ciur/papermerge/pull/33
Author: @frenos
Created: 7/11/2020
Status: ✅ Merged
Merged: 7/13/2020
Merged by: @ciur
Base:
master← Head:backup_restore📝 Commits (7)
e246ccfstart implementing backup and restore feature6f71198implement backup management commandd2929c0add unit test to backup commandb8c4d99add more testing to backup44a117dadd restore command5b3a218also backup/restore lang, add unit test for restore33d3adcMerge branch 'master' into backup_restore📊 Changes
6 files changed (+337 additions, -1 deletions)
View changed files
➕
papermerge/core/backup_restore.py(+132 -0)➕
papermerge/core/management/commands/backup.py(+23 -0)➕
papermerge/core/management/commands/restore.py(+38 -0)➕
papermerge/test/data/testdata.tar(+0 -0)➕
papermerge/test/test_backup_restore.py(+143 -0)📝
run_tests.sh(+1 -1)📄 Description
Proposed Feature:
The admin user should be able to easily export all the documents with their respective metadata. Later he should be able to import the documents again. Short: A general backup and restore feature.
To first introduce this feature and because of changing UI in the near future I propose to start off with two custom manage.py commands. One allows you to backup everything to an archive, another one allows you to restore everything from such an archive.
Planned Implementation Detail:
We not only need the original document itself but also the metadata. For this I propose to create a backup.json that contains these information about all the documents in the current backup.
Imagine this structure in papermerge:
The backup-archive will have the same relative structure and additionally contain a file
backup.jsonin the root.This file has a few meta-keys at the start and then contains a list of documents.
Example:
The top-level keys are required, for the document-obj only the path is required. All other keys that are not set use the default value (e.g. empty string). Further keys that are set and not understood by the restore are ignored. That creates a certain backwards compatibility. Think for example papermerge supports tags in the future and you export them, then you can still import that in to the current version and at least get the features supported now working.
Todo:
Future perspective:
I will try to make this first implementation as generic and plugable as possible. In the future we could improve by making it work in the worker and add it to the UI.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.