How to rename a Koha branch?

You are here:
< Back

How to rename a Koha branch?

To rename the Koha branch there is no tool provided at this time. So, the rename has to be done through SQL.


SET FOREIGN_KEY_CHECKS=0;
USE koha;
SET SQL_SAFE_UPDATES = 0;
UPDATE branches SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE items SET holdingbranch = "NEW_BRANCH" WHERE holdingbranch = "OLD_BRANCH";
UPDATE items SET homebranch = "NEW_BRANCH" WHERE homebranch = "OLD_BRANCH";
UPDATE branchtransfers SET frombranch = "NEW_BRANCH" WHERE frombranch = "OLD_BRANCH";
UPDATE branchtransfers SET tobranch = "NEW_BRANCH" WHERE tobranch = "OLD_BRANCH";
UPDATE creator_batches SET branch_code = "NEW_BRANCH" WHERE branch_code = "OLD_BRANCH";
UPDATE circulation_rules SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE article_requests SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE categories_branches SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE library_groups SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE club_enrollments SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE transport_cost SET frombranch = "NEW_BRANCH" WHERE frombranch = "OLD_BRANCH";
UPDATE transport_cost SET tobranch = "NEW_BRANCH" WHERE tobranch = "OLD_BRANCH";
UPDATE borrowers SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE aqbasket SET branch = "NEW_BRANCH" WHERE branch = "OLD_BRANCH";
UPDATE branch_borrower_circ_rules SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE branches_overdrive SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE branch_item_rules SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE edifact_ean SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE reserves SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE old_reserves SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE default_branch_circ_rules SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE illrequests SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE stockrotationstages SET branchcode_id = "NEW_BRANCH" WHERE branchcode_id = "OLD_BRANCH";
UPDATE club_templates SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE authorised_values_branches SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE hold_fill_targets SET source_branchcode = "NEW_BRANCH" WHERE source_branchcode = "OLD_BRANCH";
UPDATE opac_news SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE clubs SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE borrower_attribute_types_branches SET b_branchcode = "NEW_BRANCH" WHERE b_branchcode = "OLD_BRANCH";
UPDATE course_items SET holdingbranch = "NEW_BRANCH" WHERE holdingbranch = "OLD_BRANCH";
UPDATE collections SET colBranchcode = "NEW_BRANCH" WHERE colBranchcode = "OLD_BRANCH";
UPDATE default_branch_item_rules SET returnbranch = "NEW_BRANCH" WHERE returnbranch = "OLD_BRANCH";
UPDATE branch_transfer_limits SET toBranch = "NEW_BRANCH" WHERE toBranch = "OLD_BRANCH";
UPDATE branch_transfer_limits SET fromBranch = "NEW_BRANCH" WHERE fromBranch = "OLD_BRANCH";
UPDATE deletedborrowers SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE deleteditems SET holdingbranch = "NEW_BRANCH" WHERE holdingbranch = "OLD_BRANCH";
UPDATE deleteditems SET homebranch = "NEW_BRANCH" WHERE homebranch = "OLD_BRANCH";
UPDATE issues SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE old_issues SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE letter SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE messages SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE repeatable_holidays SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE special_holidays SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
UPDATE search_history SET query_desc = "NEW_BRANCH" WHERE query_desc = "OLD_BRANCH";
UPDATE statistics SET branch = "NEW_BRANCH" WHERE branch = "OLD_BRANCH";
UPDATE subscription SET branchcode = "NEW_BRANCH" WHERE branchcode = "OLD_BRANCH";
SET FOREIGN_KEY_CHECKS=1;


Did not find what you were looking for? Open a ticket with our Help Centre and we will get back to you resolve your issue.Click Here.
Was this article helpful?
How can we improve this article?
Need help?