mirror of
https://github.com/ciur/papermerge.git
synced 2026-04-25 12:05:58 +03:00
[GH-ISSUE #311] how to upgrade to latest version and migrate db? #244
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#244
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?
Originally created by @jjkonway on GitHub (Feb 23, 2021).
Original GitHub issue: https://github.com/ciur/papermerge/issues/311
Hello.
How can I upgrade to the latest version and transfer my files and accounts? i have tried setting up a new project & environment and simply transferring over the media folder and DB file, this worked for version 1.5.5 but caused many issues in 2.0. Im assuming there is a better way to upgrade? Any suggestions greatly appreciated!
papermerge 1.5.3.
Ubuntu 20.04
sqllite 3
gunicorn/nginx
@ciur commented on GitHub (Feb 24, 2021):
Hi,
@jjkonway, can you please be more specific about what issues you had during upgrade?
@l4rm4nd commented on GitHub (Feb 25, 2021):
I've also had some issues upgrading from version 1.5.5 to 2.0. The docker logs threw some Django errors like
I removed the old database and re-deployed the container. It then instantly worked. This may not be an acceptable workaround for people that regularly use Papermerge and have a ton of documents in the database. Maybe this is what @jjkonway meant ... a proper way to migrate the database to work for version 2.0.
@ciur: BTW, the new UI looks incredible. Really good job, keep up your amazing work!
@TheOnlyMatty commented on GitHub (Feb 26, 2021):
Also had this issue when upgrading to 2.0. Tried the steps from reddit but ran into this error which may be of use.
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration core.0033_auto_20201119_0032 is applied before its dependency core.0032_auto_20201118_1628 on database 'default'.@ciur commented on GitHub (Feb 26, 2021):
@TheOnlyMatty, @l4rm4nd, @jjkonway please help me understand what are the general steps to upgrade application XYZ docker.
I googled around "how to update docker iage and container" and found this. Is "sort of this" procedure you follow ?
I am sorry for (maybe) dump question, but I don't use docker for production.
@l4rm4nd commented on GitHub (Feb 26, 2021):
For docker containers, one usually utilizes volumes to persistently store data. You basically link an internal docker container path like /data to your host server's storage path like /mnt/papermerge or so. Your papermerge files (data & config) are then persistently saved on your server and survive a restart or re-deployment of the docker container itself. This includes the database
papermege.db.Example docker cli command to start papermege docker container by linuxserver.io
Upgrading version 1.5.5 to 2.0 is just a matter of pulling the newest docker image from e.g. linuxserver.io dockerhub and "restarting" your container. All previous settings and your stored data via docker volumes will be used again for the new container version.
The crux here seems to be that the new version 2.0 wants some database changes to run properly. However, the newest 2.0 release does not correctly migrate these changes to the "old" 1.5.5 database.
By removing the old
papermege.dbdatabase and restarting the container, a new database is created and papermerge 2.0 works properly. Might be an issue with the linuxserver.io docker image, I don't know.@w4tzmann commented on GitHub (Feb 26, 2021):
Hey @ciur ,
the way i tried to update my docker-compose setup was:
docker-compse down
docker-compose pull
cocker-compose up -d
In the docker-compose.yml file i mostly use the 'latest' tag, so when i pull new images from docker-hub I get a new version.
papermarge 'latest' tag is still 1.5.5 so i changed the tag to '2.0.0.rc35' and tried the steps above again.
Which then leads to the error with the not updated database schema.
After reading the newest reddit posts, i found this
Trying to run './manage.py migrate' in the papermerge_worker container bring me this error:
Traceback (most recent call last):
I fear I'm out now, because I have absolute no clue on Python :D
@DrVanSteiner commented on GitHub (Feb 26, 2021):
The same error occurs on the automatic migration...
@ciur commented on GitHub (Feb 26, 2021):
I am on it. I will come back with updates soon.
@ciur commented on GitHub (Feb 27, 2021):
I found the problem. It has nothing to do with docker. The issue is with migration dependencies (i.e. the order in which database changes are applied).
The fix that I will provide will work ONLY if you use latest stable release i.e. version 1.5.5.
Please upgrade to 1.5.5 first.
@ciur commented on GitHub (Feb 27, 2021):
Migration dependencies were little chaotic. The problem was fixed.
I will fix XSS issues reported for 2.0 and then I will tag a new release. With above mentioned fix you shouldn't have any problem upgrading from 1.5.5 to 2.0.
@ciur commented on GitHub (Feb 27, 2021):
all reported xss problems + migration issue were fixed. I will release tomorrow (next iteration of) release candidate.
@ciur commented on GitHub (Feb 28, 2021):
@w4tzmann, release 2.0.0rc38 is out.
You may want to try docker image provided by linuxserver.io - which is tagged v2.0.0rc38-ls28
Or
official image
I tested upgrade 1.5.5 -> 2.0.0rc38 and it worked.
@w4tzmann commented on GitHub (Feb 28, 2021):
@ciur thank you! Offical image is working for me now!