Skip to content

Commit 2ee1911

Browse files
committed
updated docs
1 parent 4b9b206 commit 2ee1911

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

Diff for: doc/OpenBiblioImport.md

+24-4
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,36 @@ podman cp ./input/usmarc_tag_dm.frm mysql-server-db:/var/lib/mysql/openbiblio
114114

115115
- Change the ownership of the files to `mysql` instead of `root`: `podman exec -it mysql-server-db /bin/bash` and `chown mysql /var/lib/mysql/openbiblio/*`
116116

117-
- Export the following tables as json, sort them by date `create_dt`: `member`, `biblio_status_hist`, `biblio`, `biblio_field`, `biblio_copy`. Copy them together in `book_all.json` (this is a bit tedious). It is important to sort by date (oldest first), because the history of rentals needs to be in the correct order.
117+
- Export the following tables as json, sort them by date `create_dt`: `member`, `biblio_status_hist`, `biblio`, `biblio_field`, `biblio_copy` into the respective file names e.g. `member.json` etc. It is important to sort by date (oldest first), because the history of rentals needs to be in the correct order.
118118

119-
- Export the `member` table into `member.json`
119+
*IMPORTANT* don't click on export, first do the sorted SQL query and then export the query result as json. For example, the member export has the query `SELECT * FROM member ORDER BY member.create_dt ASC`
120+
121+
122+
![phpMyAdmin Database Export](./openbiblio_sql_export.png)
123+
124+
- All files start with a json array with brackets, e.g. like this
125+
```
126+
[
127+
{
128+
"type": "header",
129+
"version": "5.2.1",
130+
"comment": "Export to JSON plugin for PHPMyAdmin"
131+
},
132+
{ "type": "database", "name": "openbiblio" },
133+
...
134+
```
135+
136+
- Copy them together in `book_all.json`. this is a bit tedious and best done in vscode or alike. So each key contains the content for each file, here is an example:
120137

121138
![book_all.json Structure](./openbiblio_import_structure.png)
122139

123-
*IMPORTANT* don't click on export, first do the sorted SQL query and then export the query result as json. For example, the member export has the query `SELECT * FROM member ORDER BY member.create_dt ASC`
140+
- You can validate the json as valid e.g. using a [validator](https://jsonformatter.curiousconcept.com/)
141+
142+
- Export the `member` table into `member.json`
143+
144+
124145

125146

126-
![phpMyAdmin Database Export](./openbiblio_sql_export.png)
127147

128148
- In openlibry delete the database file `dev.db` and the `migrations` folder if it exists. Then recreate them with `npx prisma migrate dev --name init`
129149

Diff for: doc/openbiblio_import_structure.png

91.1 KB
Loading

0 commit comments

Comments
 (0)