[TUTO] How to import your boards from Trello to Deck – đź“‘ How to


Hello everyone :wave:

Those of you who use Trello may have noticed: new restrictions are coming. The free ride is over (!).

At the MailTape collective, we’ve been thinking for a while that we needed to move our Trello board to the Deck app on our Nextcloud. Since there was no choice now… I took the plunge!

And not finding a tutorial, I had to figure it out quite a bit. You have to go through SSH and use Nextcloud’s occ commands directly. So, I took notes as I went along with my research and here’s a tutorial so you don’t have to go through all that again.

It’s not that complicated, and I hope with this tutorial you’ll manage to smoothly move to Deck. :tada:


We assume you have the latest version installed. As I’m writing this tutorial, I’m running Nextcloud 28.0.4 and Deck 1.12.2. Also note this tutorial has been made on a Yunohost instance. Original tutorial is in French and can be found here.


Connect via SSH with an admin account to your instance

Switch to root
sudo -su

Then go to the Nextcloud directory
cd /var/www/nextcloud

Next, test that the OCC command works fine:
sudo -u nextcloud php8.2 --define apc.enable_cli=1 occ -V

The installed version of Nextcloud should be displayed. We’re ready.

Then, refer to the Deck documentation here: User documentation – Nextcloud Deck

We can already see if Deck responds well, along with its import script.
sudo -u nextcloud php8.2 --define apc.enable_cli=1 occ deck:import -h

It should display the command’s help.

Next, Create a powerup on Trello and generate an API key.

You will then need to obtain an authentication token. Note, this is not the “secret”. You need to click on the “token” link in the instructions next to the API key. (see this video if needed)

From your SSH command on the server, send this request to obtain a JSON (table) listing all Trello boards your account is part of with their corresponding IDs:

curl --request GET
--url 'https://api.trello.com/1/members/{username}/boards?key={APIkey}&token={token}&fields=id,name'
--header 'Accept: application/json'

Replacing {username} with your Trello login, {APIkey} with the generated API key, and {token} with the token.

Example:

curl --request GET
--url 'https://api.trello.com/1/members/imacrea/boards?key=7a9743b79cf9eecd1dbfbfddddd&token=Adddddd8ed305abe1a82fa7f7e2cd16585ca46ec7902c041e16ea820915c45b4f2f72D77306FE&fields=id,name'
--header 'Accept: application/json'

:warning: This command is for retrieving the ID of a board you created with a personal account. To retrieve a board from an organization, use the following command:

curl --request GET
--url 'https://api.trello.com/1/members/{orgID}/boards?key={APIkey}&token={token}&fields=id,name'
--header 'Accept: application/json'

Where orgID is your organization name as it appears in the URL when you view the org page. For example, for https://trello.com/w/mailtape it would be mailtape

curl --request GET
--url 'https://api.trello.com/1/organizations/mailtape/boards?key=7a9743b79cf9eecd1dbdfdffbf73d26799da&token=ATTA998ed305abffffdfe1a82fa7f7e2cd16585ca46ec7902c041e16ea820915c45b4f2f72D77dfdf306FE&fields=id,name'
--header 'Accept: application/json'

Now that you have retrieved the ID of the board you want to import into Deck. You need to create a config.json file based on this schema.

Example:

{
"owner": "imacrea",
"color": "0800fd",
"api": {
"key": "7a9743b79cf9eecd1dbfdfdbf73d26799da",
"token": "ATTA998ed305abe1a82fa7f7e2cd16585cadfdf46ec7902c041e16ea820915c45b4f2f72D77306FE"
},
"board": "5022de990357dff867dfd09bbad",
"uidRelation": {
"username_sur_trello": "username_sur_nextcloud",
"george12": "george"
}
}
  • owner is the Nextcloud account username that will own the imported board.
  • color is the board’s color, don’t bother with that: we can change it in the Deck interface.
  • key your API key (see above)
  • token your token (see above)
  • board the ID of your board on Trello, retrieved with the previous command
  • uidRelation here you need to make a correspondence table between the usernames of people who are board members on Trello and their username on Nextcloud. In the example, the user “george12” is their Trello login, and “george” is their Nextcloud login.

It’s easier to prepare the contents of this file in a text editor locally, then copy the whole thing.

In the directory where we were (/var/www/nextcloud), create a json file where we will paste our config:

sudo -u nextcloud touch myBoard.json

Then open it with vim to edit

sudo -u nextcloud vi myBoard.json

Once the file is ready, we can launch the import command (and keep our fingers crossed!)

sudo -u nextcloud php8.2 --define apc.enable_cli=1 occ deck:import --system=TrelloApi --config=./myBoard.json

But there will probably be an error (unless your read this in a future where this issue has been fixed). If there’s an error, you’ll need to correct two lines of code in the importer script. Fortunately, the resolution is explained in this ticket.

Once the file is corrected, we rerun the script. And that’s it!

Once the import is done, be patient on the Nextcloud side depending on the size of the imported board. The board may then take several minutes to rebuild correctly. Of course, this setup time also depends on the power of your server.

And bye bye Trello! :tada:

Hope it helps :hugs:



Source link

Leave a Comment