en:user_advanced:greenstonesqlplugs
Differences
This shows you the differences between two versions of the page.
en:user_advanced:greenstonesqlplugs [2018/12/06 02:49] – anupama | en:user_advanced:greenstonesqlplugs [2023/03/13 01:46] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | |||
+ | |||
====== Editing archives metadata and/or fulltext using a MySQL database ====== | ====== Editing archives metadata and/or fulltext using a MySQL database ====== | ||
Like the GreenstoneMETSPlugin, | Like the GreenstoneMETSPlugin, | ||
Line 7: | Line 10: | ||
**Important Notes:** | **Important Notes:** | ||
+ | * None of this has been tested with Greenstone 2, only Greenstone 3. But it should in theory work with Greenstone 2 as well. Greenstone 2 users are invited to email the mailing list if there are any issues. UPDATE: Some testing for GS2 performed after fixing issues, as identified on mailing list. User seemed to succeed in using the GS SQL Plugs with a GS2 nightly binary. | ||
* GreenstoneSQLPlugin and GreenstoneSQLPlugout rely on the **DBI** and DBD::mysql perl packages. | * GreenstoneSQLPlugin and GreenstoneSQLPlugout rely on the **DBI** and DBD::mysql perl packages. | ||
* We've so far tested the GreenstoneSQLPlugs on Ubuntu Linux, Windows 7 64 bit and MacOS v.10.13/ | * We've so far tested the GreenstoneSQLPlugs on Ubuntu Linux, Windows 7 64 bit and MacOS v.10.13/ | ||
Line 12: | Line 16: | ||
* For Windows binaries, we provide you with a Strawberry Perl that has the correct versions of DBI and DBD::mysql. If you're working with Greenstone source distributions or source code from svn on Windows, you can grab Strawberry Perl 5.22 [[http:// | * For Windows binaries, we provide you with a Strawberry Perl that has the correct versions of DBI and DBD::mysql. If you're working with Greenstone source distributions or source code from svn on Windows, you can grab Strawberry Perl 5.22 [[http:// | ||
* For newer versions of Mac, your pre-installed DBI package may be fine, but you may be missing DBD::mysql. Or perhaps you have an older version of DBD::mysql. In that case, refer to the Mac instructions at [[http:// | * For newer versions of Mac, your pre-installed DBI package may be fine, but you may be missing DBD::mysql. Or perhaps you have an older version of DBD::mysql. In that case, refer to the Mac instructions at [[http:// | ||
+ | * **UPDATE:** If you're on Linux or on a Mac High Sierra machine, and you don't have DBI or DBD, also refer to the instructions at [[http:// | ||
You can check you have the DBI and DBD::mysql packages installed as part of your perl in whatever OS you're working on. To test you have DBI and DBD::mysql installed and also find their versions, run the following command in perl: | You can check you have the DBI and DBD::mysql packages installed as part of your perl in whatever OS you're working on. To test you have DBI and DBD::mysql installed and also find their versions, run the following command in perl: | ||
Line 25: | Line 30: | ||
===== The short version: Usage instructions ===== | ===== The short version: Usage instructions ===== | ||
+ | * The perl packages DBI version 1.634 and DBD::mysql version 4.033 must be installed. They come with Windows GS3 binaries, and these packages may already be present on your Mac or Linux machine (if not see [[http:// | ||
+ | * Rename the files '' | ||
* At present there' | * At present there' | ||
* Make sure you're [[# | * Make sure you're [[# | ||
* After creating a new Greenstone collection, open up '' | * After creating a new Greenstone collection, open up '' | ||
* add in an element for the **GreenstoneSQLPlugout** | * add in an element for the **GreenstoneSQLPlugout** | ||
- | * //replace// the GreenstoneXMLPlugin element with one for **GreenstoneSQLPlugin**. (It should notably take GreenstoneXMLPlugin' | + | * **// |
* **The configure options for both GreenstoneSQLPlugs are the same and need to be set consistently for both.**\\ Snippet of example configuration in '' | * **The configure options for both GreenstoneSQLPlugs are the same and need to be set consistently for both.**\\ Snippet of example configuration in '' | ||
< | < | ||
Line 38: | Line 45: | ||
<option name=" | <option name=" | ||
<option name=" | <option name=" | ||
- | <option name=" | + | <option name=" |
<option name=" | <option name=" | ||
[<option name=" | [<option name=" | ||
Line 51: | Line 58: | ||
< | < | ||
< | < | ||
- | < | + | < |
< | < | ||
[< | [< | ||
Line 62: | Line 69: | ||
</ | </ | ||
- | * Run (incremental-)import and (incremental-)build normally:\\ < | + | * Once the collectionConfiguration.xml file has been correctly setup, you can run GLI, open the hand configured collection in there, and then run build in there.\\ Alternatively, |
- | (incremental-)buildcol.pl -activate -site < | + | buildcol.pl -activate -site < |
+ | incremental-buildcol.pl -activate | ||
* Start your GS3 server if you haven' | * Start your GS3 server if you haven' | ||
- | * You can now at any time [[# | + | * You can now at any time [[# |
* But **once you log into MySQL client, always first set the connection to use the '' | * But **once you log into MySQL client, always first set the connection to use the '' | ||
- | * The GreenstoneSQLPlugs create a **database** called ''< | + | * The GreenstoneSQLPlugs create a **database** called ''< |
* Up to 2 **tables** are created for each collection: ''< | * Up to 2 **tables** are created for each collection: ''< | ||
**Notes on GreenstoneSQLPlugin/ | **Notes on GreenstoneSQLPlugin/ | ||
* Set '' | * Set '' | ||
- | * The values for '' | + | * The values for '' |
* Experimental feature: If you set '' | * Experimental feature: If you set '' | ||
Line 79: | Line 87: | ||
==== Prerequisites ==== | ==== Prerequisites ==== | ||
* You need to have MySQL 5.5 or greater installed (for utf8mb4 support). We tested with mysql version 5.7.23. See [[# | * You need to have MySQL 5.5 or greater installed (for utf8mb4 support). We tested with mysql version 5.7.23. See [[# | ||
- | * Your perl must have the DBI package, as discussed at the top of this page. | + | * The perl packages |
+ | * Only if DBD and DBI are installed should you make the Greenstone SQL plugs active as follows. (Beware that activating the plugs otherwise can prevent GLI from launching) | ||
+ | * rename '' | ||
+ | * rename '' | ||
* Before you build a collection using these plugins, your MySQL server needs to be running. Moreover, it needs to have been launched with the character set encoding set to utf8mb4:\\ < | * Before you build a collection using these plugins, your MySQL server needs to be running. Moreover, it needs to have been launched with the character set encoding set to utf8mb4:\\ < | ||
Line 133: | Line 144: | ||
<option name=" | <option name=" | ||
<option name=" | <option name=" | ||
- | <option name=" | + | <option name=" |
<option name=" | <option name=" | ||
[<option name=" | [<option name=" | ||
Line 145: | Line 156: | ||
< | < | ||
< | < | ||
- | < | + | < |
< | < | ||
[< | [< | ||
Line 160: | Line 171: | ||
Leave out '' | Leave out '' | ||
- | You can now preview your Greenstoen | + | You can now preview your Greenstone |
b. GLI-SPECIFIC WAY. | b. GLI-SPECIFIC WAY. | ||
Line 243: | Line 254: | ||
tar -xvzf mysql-5.7.23-macos10.13-x86_64.tar.gz</ | tar -xvzf mysql-5.7.23-macos10.13-x86_64.tar.gz</ | ||
* You may end up with a folder like / | * You may end up with a folder like / | ||
- | * Apple stopped distributing the MySQL database driver (DBD:: | + | * Apple stopped distributing the MySQL database driver (DBD:: |
Line 268: | Line 279: | ||
Username '' | Username '' | ||
< | < | ||
- | mymachine: | + | mymachine: |
- | ./mysqld --datadir / | + | ./bin/mysqld --datadir / |
2018-10-03T05: | 2018-10-03T05: | ||
Please use --explicit_defaults_for_timestamp server option (see documentation for more details). | Please use --explicit_defaults_for_timestamp server option (see documentation for more details). | ||
Line 287: | Line 298: | ||
</ | </ | ||
- | 3. Run the MySQL server (passing in --console is necessary on Windows to see any error messages): | + | 3. Run the MySQL server (passing in '' |
- | < | + | < |
+ | --datadir / | ||
+ | [--console] \ | ||
+ | [--lc-messages-dir / | ||
4. **Change root password** ([[https:// | 4. **Change root password** ([[https:// | ||
Line 328: | Line 342: | ||
< | < | ||
mymachine: | mymachine: | ||
- | ./ | + | ./ |
+ | | ||
</ | </ | ||
Line 360: | Line 375: | ||
===== Building the DBD::mysql package for Mac OS v 10.13 ("High Sierra" | ===== Building the DBD::mysql package for Mac OS v 10.13 ("High Sierra" | ||
+ | |||
+ | ==== Automated way ==== | ||
+ | The automated way should suffice if you're on a MacOS v 10.13/High Sierra machine. The script needs internet access. | ||
+ | |||
+ | Open a terminal and | ||
+ | |||
+ | for GS3: | ||
+ | < | ||
+ | for GS2 (untested): | ||
+ | < | ||
+ | |||
+ | Ensure the compile-dbd-mysql.sh script has execute permissions: | ||
+ | < | ||
+ | |||
+ | (The script has now been modified to work on Linux too, besides Mac. And it has further been updated to support compiling up DBI besides DBD. If you want DBI compiled up too, then use a text editor to open up the script compile-dbd-mysql.sh. Locate the line that says: | ||
+ | < | ||
+ | Change the value to true: | ||
+ | < | ||
+ | Save the file and close the text editor before proceeding.) | ||
+ | |||
+ | Now run it: | ||
+ | < | ||
+ | |||
+ | The above script will: | ||
+ | 1. download and install mysql v 5.7.23 inside your GSDLHOME (the GS3/ | ||
+ | 2. download and compile DBD::mysql v 4.033 against the above mysql installation' | ||
+ | |||
+ | Once the script has finished running | ||
+ | * if you want, you can move the $GSDLHOME/ | ||
+ | * Follow the [[http:// | ||
+ | |||
+ | |||
+ | ==== Manual way ==== | ||
These instructions are for installing the perl package DBD::mysql version 4.033 on MacOS 10.13/High Sierra. | These instructions are for installing the perl package DBD::mysql version 4.033 on MacOS 10.13/High Sierra. | ||
+ | |||
+ | The automatic script above takes cares of all this. But if there are any issues with that, or if you want to attempt the same process of building the DBD::mysql package with different versions of either perl, DBD::mysql or mysql itself, then these steps may be useful. | ||
1. Get the DBD::mysql source package. Since on Windows we worked with DBD::mysql version 4.033, and we've now successfully built and tested that version on a High Sierra Mac using the Greenstone Plugs, we recommend the same version: | 1. Get the DBD::mysql source package. Since on Windows we worked with DBD::mysql version 4.033, and we've now successfully built and tested that version on a High Sierra Mac using the Greenstone Plugs, we recommend the same version: | ||
Line 464: | Line 514: | ||
* Discuss table columns, column names and column types. Although users could probably see this from the table' | * Discuss table columns, column names and column types. Although users could probably see this from the table' | ||
* Have not yet tested writing out just meta or just fulltxt to sql db and reading just that back in from the sql db while the remainder is to be read back in from the docsql .xml files. | * Have not yet tested writing out just meta or just fulltxt to sql db and reading just that back in from the sql db while the remainder is to be read back in from the docsql .xml files. | ||
- | * Test on windows and mac. | + | * DONE: Tested |
en/user_advanced/greenstonesqlplugs.txt · Last modified: 2023/03/13 01:46 by 127.0.0.1