if ($trelloObj->prefs->permissionLevel == "private") { echo "project is private" . PHP_EOL; // $client->updateProject(array('id' => $projectId, 'is_public' => false)); } # will only get lists that are not archived $jsonString = file_get_contents("https://trello.com/1/boards/" . $trelloboard . "/lists?key=" . $trellokey . "&token=" . $trellotoken); $trelloObjLists = json_decode($jsonString); //add the lists echo 'Adding lists.' . PHP_EOL; foreach ($trelloObjLists as $list) { if ($list->closed) { // ignore archived lists continue; } echo 'Creating list ' . $list->name . PHP_EOL; $columnId = $client->addColumn($projectId, $list->name); $trelloLists[$list->id] = $columnId; //add each card echo 'Adding cards.' . PHP_EOL; $query = "https://trello.com/1/lists/" . $list->id . "?key=" . $trellokey . "&token=" . $trellotoken . "&cards=open&card_fields=all&card_checklists=all&members=all&member_fields=all&membersInvited=all&checklists=all&organization=true&organization_fields=all&fields=all"; // &actions=commentCard,copyCommentCard&card_attachments=true"; $jsonCards = file_get_contents($query); $trelloObjCards = json_decode($jsonCards); foreach ($trelloObjCards->cards as $card) { addCard($projectId, $columnId, $card); } } echo 'All done!' . PHP_EOL; die; function addCard($projectId, $columnId, $card) {