trello-full-backup icon indicating copy to clipboard operation
trello-full-backup copied to clipboard

Teams

Open OliPlus opened this issue 6 years ago • 2 comments

OK, I found that teams are supported with the '--organizations' switch. There is one small bug in the organizations.

The folder 'me' contains always all 'Boards'. Hence if a board 'Board 1' belongs to the organization/team 'Team 1' this board shows up in the backup two times.

2015-11-12_23-28-36_backup/ └── me ...└── Board 1 └── team 1 ...└── Board 1

This increases the amount of downloaded data big time.

OliPlus avatar Mar 12 '18 03:03 OliPlus

` org_boards_data = {} my_boards_url = '{}members/me/boards{}'.format(API, auth)

orgs = []
if args.orgs:
    org_boards_data['Personal Boards'] = requests.get(my_boards_url).json()
    org_url = '{}members/me/organizations{}'.format(API, auth)
    orgs = requests.get(org_url).json()
else:
    org_boards_data['All Boards'] = requests.get(my_boards_url).json()

for org in orgs:
    boards_url = '{}organizations/{}/boards{}'.format(API, org['id'], auth)
    boards_data = requests.get(boards_url).json()
    for board in boards_data:
        org_boards_data['Personal Boards'].remove(board)
    org_boards_data[org['displayName'] + ' (' + org['name'] + ')'] = boards_data

for org, boards in org_boards_data.items():
    print('Processing', org)
    mkdir(org)
    os.chdir(org)
    boards = filter_boards(boards, args.closed_boards)
    for board in boards:
        backup_board(board, args)
    os.chdir('..')

print('Trello Full Backup Completed!')`

This is my solution at the end of the backup script which solves the problem.

I added print('Backup organizations:', bool(args.orgs)) behind print('Backup archived lists:', bool(args.archived_lists)) , too.

OliPlus avatar Mar 12 '18 06:03 OliPlus

Thanks for the report!

There is a work in progress in PR #17 to drop support for the folder tree structure and clean things up a bit. We can get your fix in once this is done.

jtpio avatar Mar 12 '18 18:03 jtpio