Vue normale

Reçu avant avant-hier

Data migration: bulk check-in

Par :Vimal
18 octobre 2019 à 11:02
Bulk check-in using .koc (Koha Offline Circulation) file is easy to use the method. It is helpful while Koha trial runs for data migration from the old version of Koha or other software. This method also can apply to other contexts. The following steps discuss how to prepare the .koc file for bulk import of check-in entries.


1. Export report of desired checked out books

Koha > Report > Create from SQL

Use following SQL query to build a report for the purpose,

SELECT issues.issuedate,items.barcode 
FROM issues 
LEFT JOIN borrowers ON borrowers.borrowernumber=issues.borrowernumber 
LEFT JOIN items ON issues.itemnumber=items.itemnumber   
LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
WHERE items.homebranch =<<Branch|branches>> AND issues.issuedate BETWEEN <<Between Date (yyyy-mm-dd)|date>> and <<and (yyyy-mm-dd)|date>> ORDER BY issues.issuedate DESC

Download the report as a CSV or ODS (Open Document Spreadsheet) file.

2. Prepare the .koc file

Open the checked-out report file and add a new column to the mention transaction type.
Copy the contents in three columns. See the sample CSV file here.


Download and open the sample .koc file from here.
Copy and paste the contents below the first line in the .koc file.


Save and close the file.

3. Import the .koc file

Goto Koha > Circulation > Offline circulation > Upload offline circulation file (.koc) 
Find and upload the .koc file. Don't worry, if the screen show time out.

Goto Koha > Circulation > Offline circulation > Pending offline circulation actions
Select all the entries and click the Process button.

References

Firefox Addon for Koha Offline circulation
https://addons.mozilla.org/en-US/firefox/addon/koct/

Koha offline circulation file format
https://wiki.koha-community.org/wiki/Koha_offline_circulation_file_format

Data migration: importing of check-out entries from an old version of Koha

Par :Vimal
28 septembre 2019 à 15:47
Restoration of an old version of a corrupted database to the latest version of Koha is a challenging task. Data migration from a running instance of an old version of Koha is comparatively easy. Porting of bibliographic records to MARC format, patron details and circulation details to CSV is possible. Then it can be imported into a new version of Koha.

This tutorial discusses the various stages in exporting of check-out (issue) details from the old version of Koha into latest version.


Background preparation

  • Export bibliographic details (MARC format), patron and circulation details.
  • Install a new version of Koha. Create branch code, Patron categories, Authorised values, circulation and fine rules same like the old version of Koha.
  • Import MARC file and patron details.

Exporting of checkout entries

Prepare a report of all books checked out

Koha > Report > Create from SQL Enter following SQL query.

SELECT issues.issuedate,borrowers.cardnumber,items.barcode 
FROM issues  
LEFT JOIN borrowers ON borrowers.borrowernumber=issues.borrowernumber   
LEFT JOIN items ON issues.itemnumber=items.itemnumber    
LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber 
ORDER BY issues.issuedate DESC

Run the report and export it as CSV format.

Create offline circulation file


Open the All Book Checkout Out report in LibreOffice or any other spreadsheet application.

Add a new column between issuedate and cardnumber columns. Put the line 'issue' in all rows. Koha recognises that these entries for checkout of books. 


Transfer checkout entries from CSV file to .koc file.

koc stands for (Koha Offline Circulation.Download a sample .koc file from here. Open the .koc file using a text editor (e.g. leafpad. mousepad). Copy the entire checkout entries from csv (except column names) to .koc file.


Save and close the .koc file.

Import .koc file into Koha

Make sure that all records, patron details imported into Koha before import .koc file. Circulation rules should be created.

Koha > Circulation > Offline circulation > Upload offline circulation file (.koc)



Choose the .koc file and upload.
The screen may show a timeout. The process will go on behind. Check the status after a few minutes.

Koha > Circulation > Offline circulation > Pending offline circulation actions

The check out entries successfully imported

Calculate the fine

Run the following commands to calculate the fines.

cd /etc/cron.daily/
sudo ./koha-common

Check the status of successful entries by visiting a patron account.

❌