Skip to content

Commit f9eebe9

Browse files
author
Marcel Neumann
committed
synchronise english and german version
1 parent fccadc1 commit f9eebe9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/en/migration.md

+17
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,23 @@ If you don't want to create any field types, you can start the data migration wi
3030
```bash
3131
python vocabulary-migrator.py --vocabulary-server-host localhost --vocabulary-server-port 8081 --goobi-database-host localhost --goobi-database-port 3306 --goobi-database-name goobi --goobi-database-user goobi --goobi-database-password goobi --continue-on-error --fallback-language eng
3232
```
33+
34+
### Script
35+
The above two points, the virtual Python environment and the migration of the vocabulary data in a typical installation, as root:
36+
```bash
37+
cd /opt/digiverso/vocabulary/migration
38+
python3 -m venv vmenv
39+
. vmenv/bin/activate
40+
pip install requests mysql-connector-python==8.4.0 alive_progress lxml
41+
VOC_PORT=$(sudo grep -oP '^server.port=\K.*' /opt/digiverso/vocabulary/application.properties)
42+
VOC_TOKEN=$(sudo grep -oP '^security.token=\K.*' /opt/digiverso/vocabulary/application.properties)
43+
DB_GOOBI_PW=$(sudo xmlstarlet sel -t -v '//Resource/@password' -n /etc/tomcat9/Catalina/localhost/goobi.xml)
44+
python vocabulary-migrator.py --vocabulary-server-host localhost --vocabulary-server-port "${VOC_PORT}" --vocabulary-server-token "${VOC_TOKEN}" --goobi-database-host localhost --goobi-database-port 3306 --goobi-database-name goobi --goobi-database-user goobi --goobi-database-password "${DB_GOOBI_PW}" --continue-on-error --fallback-language ger
45+
46+
# Test
47+
curl -s http://localhost:8081/api/v1/vocabularies --header "Authorization: Bearer $VOC_TOKEN" | jq -r '._embedded.vocabularyList[] .name'
48+
```
49+
3350
**Hint** Change the parameters according to your configuration. The `fallback-language` parameter defines the default language to be used for a multi-lingual vocabulary field for which no default language could be derived. The `continue-on-error` option prevents the migration tool to stop on data migration errors. These errors can occur if the data could not be inserted into the new vocabulary server. Possible reasons might be:
3451
- The vocabulary record is empty.
3552
- The vocabulary record contains data that is incompatible with some type restrictions.

0 commit comments

Comments
 (0)