wekan
wekan copied to clipboard
Import from trello is broken
Issue
Using docker-compose from 2 apr 2023, I tried to import a trello board. But seems to fail.
Server Setup Information
- docker compose from github
WeKan ® info - 6.81.0
Meteor - 2.11.0
Node 14.21.3
Mongo 6.0.5
Problem description
Reproduction Steps
- install from docker compose
- go to trello board with attachments (some random images)
- import from trello
Logs
Exception while invoking method 'importBoard' ReferenceError: Attachment is not defined
at models/trelloCreator.js:452:13
at Array.forEach (<anonymous>)
at models/trelloCreator.js:429:21
at Array.forEach (<anonymous>)
at TrelloCreator.createCards (models/trelloCreator.js:291:17)
at TrelloCreator.create (models/trelloCreator.js:763:10)
at MethodInvocation.importBoard (models/import.js:35:20)
at packages/check/match.js:118:15
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1329:12)
at Object._failIfArgumentsAreNotAllChecked (packages/check/match.js:116:43)
at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1899:18)
at getCurrentMethodInvocationResult (packages/ddp-server/livedata_server.js:772:38)
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1329:12)
at packages/ddp-server/livedata_server.js:791:46
at new Promise (<anonymous>)
at Session.method (packages/ddp-server/livedata_server.js:739:23)
at packages/ddp-server/livedata_server.js:603:43
Is there a way to solve the problem? Maybe a rollback to an older version or something like that?
@AR1ES
Import from Trello code is here https://github.com/wekan/wekan/tree/master/models
Trello made new requirement for API key when downloading attachments, example to download with Python here https://github.com/wekan/wekan/tree/master/trello
So that kind of download with Javascript should be added to WeKan to wekan/models/
Trello API key input field can be added to https://github.com/wekan/wekan/tree/master/client/components/import
WeKan can be built and send PR this way https://github.com/wekan/wekan/wiki/Emoji
Alternatively, someone can fund import from Trello feature with 1000 euro at https://wekan.team/commercial-support/
Import attachments from Trello is funded, I try to fix it this year.
Related #4417
Related attachment code https://github.com/wekan/wekan/issues/3950#issuecomment-1370293213
https://github.com/wekan/wekan/wiki/Sync
I thought I saw that funding was obtained, has this made any progress? Since I can't see a direct way to even import without attachments this is kind of a mess right now for moving from Trello.
@n9yty
Yes, there is funding, and developing fixes for importing boards with attachments from Trello is In Progress.
With the latest version 7.36 the problem persists.
Hi @xet7
Starting Apr 8, Trello free Workspaces will be limited to 10 collaborators. We are trying to import our Trello Boards to Wekan and getting the same error.
@S733
Thanks for info ! I try to fix before Apr 8.
same problem here
same problem here
Thanks for info ! I try to fix before Apr 8.
Nice! I'll offer to help with testing if needed.
Help ?
Does someone know, how to save attachment from Trello with some code, with any programming language? Or can someone help to find out? I tried some older ways to save attachment, they did not work. I'm also reading Trello docs currently, trying to figure it out, how it works in newest version.
Using cURL does not work
Trying to use cURL does not work, there is error unauthorized permission requested
.
I tried copying cookies etc, at browser (Firefox or Chromium based, at:
Right Click Inspect / Network / Reload / Right click jpeg image / Copy value / Copy as cURL
For cookies at Right click Inspect / Console
, get cookies this way:
console.log(document.cookie);
And I tried with cURL this way:
curl 'https://trello.com/1/cards/CARD-ID-HERE/attachments/ATTACHMENT-ID-HERE/previews/PREVIEW-ID-HERE/download/IMAGENAME-HERE.jpeg.jpg' \
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0' \
-H 'Accept: image/avif,image/webp,*/*' -H 'Accept-Language: fi,en-US;q=0.5' -H 'Accept-Encoding: gzip, deflate, br' \
-H 'Referer: https://trello.com/c/BOARD-ID-HERE/CARD-URL-HERE' \
-v --cookie 'COOKIES-HERE'
About Trello attachment downloader
This is Linux Python3 QT GUI for downloading Trello attachments: https://github.com/SeyedEhsanHosseini/TCAD
It works, but problem is, this gives permission to everything to PowerUp, that is created by 3rd party developer. I do not know, is there source code of PowerUp somewhere, does it save some info elsewhere or not?
Info about this PowerUp is here: https://community.atlassian.com/t5/Trello-questions/Download-All-Attachments-from-Trello-Card/qaq-p/9805594
Previous Trello attachment download code does not work: https://github.com/wekan/wekan/blob/main/trello/api.py
I tried with some API keys, it did not allow to download files.
At Trello, it is possible to export board JSON, and look at that JSON for attachment files, copying URLs to tabs where user is logged into Trello, and view and download each attachment. But it's not practical, if there is a lot of attachments.
There are some browser extensions for downloading Trello attachments, but those are not verified by Mozilla, I'm not sure can those be trusted, is source code of those extensions somehere?
Currently reading this:
https://developer.atlassian.com/cloud/trello/guides/rest-api/authorization/
I forked Trello Attachment Downloader, and made it to not use 3rd party. I'm currently downloading Trello JSON, and attachments with this downloader:
https://github.com/wekan/trello-attachments-downloader
I recommend that others also download their Trello JSON and attachments of each board.
Next, I will make possible importing this Trello JSON and attachments to WeKan.
I forked Trello Attachment Downloader, and made it to not use 3rd party. I'm currently downloading Trello JSON, and attachments with this downloader:
https://github.com/wekan/trello-attachments-downloader
I recommend that others also download their Trello JSON and attachments of each board.
Next, I will make possible importing this Trello JSON and attachments to WeKan.
Hi @xet7, thanks for getting the attachment download option, any update on the wekan import option?
@S733
For WeKan Import, currently I'm thinking about some separate WeKan Uploader GUI or script, that would use WeKan API with some seconds pause between API calls, because some Trello boards are so big, that current Meteor WeKan internal import page timeouts with big files and copy-paste using web browser. Some do not have enough RAM at their laptop, to be able to copy-paste as text.
In practice, that would mean adding some additional API to WeKan, like uploading attachments, and other missing API calls.
Will there be any web gui or docker for this process?
@liferadioat
Other way could be:
- At same page where currently is paste Trello JSON, have option of uploading .zip file that would have Trello JSON file and attachments.
- After upload, at serverside .zip file would be extracted, and added to WeKan.
I presume, that for all Import and Export options, it would be most practical to have those internally at WeKan webpages.
Hi @xet7, thank you for all your work and support on this.
I am experiencing the Exception while invoking method 'importBoard' ReferenceError: Attachment is not defined
issue.
I took a look into the tool you developed https://github.com/wekan/trello-attachments-downloader and I was able to download all the attachments of the boards that are giving import expections.
While you work on the import issue is there any work around that I can follow to import the cards from trello?
At the moment the trello JSON import only works until it throws the exception. If I get the exception on the 4th card it will stop there and the imported board only shows 4 cards. I was wondering if I have to remove all the attachments information from the JSON structure, or if is there any ignore attachments on import option, in order to get all cards imported. Or if you have other suggestion to import all cards information even without attachments for the time being.
Thank you
@carloslindo-alx
Well, it will be fixed some way, after that it will work without any errors, I presume.
Point is to write code, that for each part of Trello JSON inserts it correctly to WeKan.
Current Trello import code is here:
https://github.com/wekan/wekan/blob/main/models/trelloCreator.js
When there are some errors, some code needs fixing.
Small thing i would like to add:
Would not be a 100% solution, but the error also occurres when you have just links attached to the card. Nothing to download there. Maybe you could fix the importer in a way, where while it ignores custom uploaded attachments it still loads all cards so we can get our stuff transferred? Worst case we have to reupload the Custom Content manually.
@oninoni
Would not be a 100% solution, but the error also occurres when you have just links attached to the card.
Do you mean links to other websites? Are those links originally from cards at Trello?
I mean non-File Attachments. Probably just links (Internally or externally) (Ignore the German)
Either way disabling importing attachments temporally would probably help a lot if wekan doesn't abort importing at the first attachment.
@oninoni
Maybe you could fix the importer in a way, where while it ignores custom uploaded attachments it still loads all cards so we can get our stuff transferred? Worst case we have to reupload the Custom Content manually.
Oh no. Please, no:
- partial fix
- worst case fix
- workaroud
I prefer coding properly working import, thanks!