mirror of
https://github.com/plankanban/planka.git
synced 2026-02-05 00:39:58 +03:00
How to update via Docker? #112
Reference in New Issue
Block a user
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 @pzehle on GitHub (Jun 30, 2021).
I keep pulling the 'latest' image from Docker, but I cannot see the latest changes in the project and Docker keeps saying that I have the 'latest' image, even though the image it is pulling has the tag that it was created 2 months ago, instead of 5 days ago, like the latest image here: Docker Hub.
@Syndamia commented on GitHub (Jun 30, 2021):
The current latest version is
1.0.0-beta, so you'll need to pull that image:BUT IF YOU WANT TO UPDATE AN EXISTING SETUP
Back up your database! This update features some database structure changes, you'll either need to manually update the database or just start from scratch.
How I updated my database (Linux)
knex migrate:latest, but I haven't tested itError: The migration directory is corrupt, just doselect * from board;to view information about all boards, thenselect * from user_account;for viewing all accountsboardidmust be replaced with the desired board id, anduserid- desired user idproject_membershipdata toproject_managerproject_membershiptable afterwards, since it seems that it's not needed anymore, but it won't to any harm if you leave itcardtable0should be replaced by a User's id.attachmenttableAnd everything should be working. If you're getting stuck on loading anywhere, you can check database output messages with:
@pzehle commented on GitHub (Jun 30, 2021):
Thank you very much. Will try and if anything goes wrong I will post it here.
@johnchristopher commented on GitHub (Aug 16, 2021):
@Syndamia :
Great ! Should you destroy the containers first and recreate them with the 1.0.0-beta version image and then follow the steps for manual migration or should the manual migration steps be done before switching to new image ?
edit: to answer my own question: it seems you have to stop your running containers, change planka image tag, recreate containers and follow the steps.
Unfortunately it doesn't seem to work. I completed the procedure three times from a back-up and I get the same results: black screen in the browser and no logs from either containers and a lot of javascript error in the browser console.
@Syndamia commented on GitHub (Aug 17, 2021):
Edit I revisited my old explanation and my server and I found the original answer out of place.
I also found a mistake (that is now fixed). To check the database output, run this command:
If you still don't find any info, could you send some of the JavaScript error messages?
@johnchristopher commented on GitHub (Aug 19, 2021):
@Syndamia : Here's the complete output:
I just noticed this line:
And here's the console output:
I fixed(?) the postgresql error by replacing
insert into project_manager (id, project_id, user_id, created_at, updated_at) select id, project_id, user_id, created_at, updated_at from project_membership;withinsert into public.project_manager (id, project_id, user_id, created_at, updated_at) select id, project_id, user_id, created_at, updated_at from project_membership;but the console javascript errors remain.edit: and to be perfectly clear, I have backups of every volumes and I restore them and recreate 0.16 containers before each tr and I get a functioning planka populated with my data.
@TheFrazer commented on GitHub (Aug 19, 2021):
I didn't have any problems with the database update and also had no errors there, but get the same js errors.
@johnchristopher commented on GitHub (Aug 21, 2021):
As a rule of thumb
latesttag should never be used because there are not guarantee it's the actual latest build (or that the build was produced from the most up to date code). The tag label is just a free field without constraints. See https://vsupalov.com/docker-latest-tag/ and https://www.cloudsavvyit.com/10691/understanding-dockers-latest-tag/What happens is that since you most likely have a local image of Planka tagged with
latestthe container is being created from that local image. It doesn't pull outlatestfrom the web. Remove that image and it will pulllatestfrom the web. That's why you can never be sure you have the image you think you have if you rely on thelatesttag.@TheFrazer commented on GitHub (Aug 21, 2021):
Ok, I created a new database and let planka create the schemes. Then I copied each table from the old database one by one to the new database. When I copy board_membership it results in the js error and the site not loading. Leaving this table out and adding myself to every board on the website seems to work just fine. So it is working for me again.
@johnchristopher commented on GitHub (Aug 21, 2021):
OK, I was also able to upgrade to
planka:1.0.0-betafromplanka:0.1.6but since @TheFrazer went one way (copying tables data) I decided to go another (updating tables).If you know your user id here's the SQL query to run. Then login and reclaim ownership of each board:
Those steps are for when only one user created projects and cards. It's possible to adapt but you most likely may have to manually update ownership of cards, boards and projects. Either through Planka's web UI (easy but can take some time) or through SQL (harder but can be processed in batches).
On a running docker setup:
adminerhttp://localhost:3001 out of convenience but you could run an SQL file as an input query to the database server from the postgres container just as easily.Add the following to the
docker-compose.ymlthat ships with Planka (user:postgres, password: postgres, server:postgres) :and run
UPDATE card SET creator_user_id=with the user id you got at step 3:7b. Step 5 from @Syndamia should also work if you don't want to click through Planka's web UI to add yourself back as board owner but there could be problems.
For instance: after inserting all the rows Planka's web UI would turn black again. Upon inspection I found an orphaned board in the
board table(that board had no associated cards in thecardtable and its name was identical to another board... maybe it got deleted from the UI, is hidden because it has no child board but it's still present in the database ?) and when I removed the insert statement that referenced that board then Planka's web UI was operating normally again.Qestion to the pgql guru and @meltyshev. Is it safe to do that:
@immanuelfodor commented on GitHub (Apr 21, 2022):
Is there a bash one-liner or something like that for backing up the whole Planka 0.1.6 DB? And maybe an easy restore one-liner? 😀
PG is not so easy to backup and restore, I had bad experience regarding it with complex DBs before, so I would like a bullet-proof method instead of a trial&error process with lots of downtime if things go sour with the DB upgrade.
@upuldi commented on GitHub (Apr 25, 2022):
This fixed my issue. Saved me 1000s of hours. THANK YOU.......
ALSO, I had to manually update the migration table to match the new migration table. I created a fresh DB and pointed PLANKA to it, once it got populated, copied the migrations table from the new database to the old database. What I noticed is even though both of the tables have the same number of records they are different to one. another. After updating the migration table to match with the new migration table I pointed the PLANKA back to the old DB. Thats it.
If you find you don't have access to projects or boards, You will have to manually add records to the tables. XXX is your user id.
You might have to do the same for the project membership table.
Also, make sure to run a scheduled backup of the DB.
pg_dump -U postgres planka | gzip > planka.gz
Add the following to the cron tab.
24 1 * * * /backup/.postgres-planka-backup -U postgres
@Pheggas commented on GitHub (May 4, 2022):
After downloading the membership table, and applying migration, knox throws error: Migration "20180721234154_create_project_manager_table.js" not found.
While that file is clearly there:

Is this a bug?
@shamoon commented on GitHub (Jun 28, 2022):
Any ideas why I get this same error now every time the container is recreated? I no longer have to perform migrations of course just
wgetthe file and planka is happy again. Im runninglatestand I see the migration exists in my db:Also tbh I dont really understand why that file is still not in the docker image and this error persists?
@johngalactic commented on GitHub (Jul 23, 2022):
After following the instructions in @johnchristopher 's post, I still had to deal with migrations being broken. After I updated my 0.1.6 DB to 1.0.0-beta following these instructions: https://github.com/plankanban/planka/issues/139#issuecomment-903116496
I ran this to update the migration table on 1.0.0-beta. Afterwards I was able to update to 1.1.0, then 1.1.3, 1.2.1, 1.3.1, 1.4.0. I stepped through it to verify the migrations run automatically.
I believe the reason people have to do
wgetis because20180721234154_create_project_membership_table.jswas deleted from the migration folder and replaced with20180721234154_create_project_manager_table.js. The migration table in 0.1.6 has a record for a migration with20180721234154_create_project_membership_table.jswhich no longer exists in the newest code base.@daniel-hiller commented on GitHub (Jul 17, 2024):
https://docs.planka.cloud/docs/installation/docker/update