User Tools

Site Tools


en:user_advanced:greenstonesqlplugs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:user_advanced:greenstonesqlplugs [2019/09/05 07:11] anupamaen: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, the GreenstoneSQLPlugin is another alternative to using the GreenstoneXMLPlugin. Like the GreenstoneMETSPlugin, the GreenstoneSQLPlugin is another alternative to using the GreenstoneXMLPlugin.
Line 13: 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://trac.greenstone.org/export/32658/main/trunk/release-kits/shared/windows/perl.zip|from here]], which includes versions of these packages that we tested the Greenstone SQL Plugs successfully against.      * 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://trac.greenstone.org/export/32658/main/trunk/release-kits/shared/windows/perl.zip|from here]], which includes versions of these packages that we tested the Greenstone SQL Plugs successfully against.
      * 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://wiki.greenstone.org/doku.php?id=en:user_advanced:greenstonesqlplugs#getting_and_running_mysql | Getting and running MySQL]] on how to get DBD::mysql on Mac 10.13/High Sierra.      * 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://wiki.greenstone.org/doku.php?id=en:user_advanced:greenstonesqlplugs#getting_and_running_mysql | Getting and running MySQL]] on how to get DBD::mysql on Mac 10.13/High Sierra.
-     * **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://wiki.greenstone.org/doku.php?id=en:user_advanced:greenstonesqlplugs#building_the_dbdmysql_package_for_mac_os_v_1013_high_sierra | Building the DBD (and DBI) perl packages]]. Compiling DBD and the Greenstone SQL plugs' use of it were already tested for the Mac. The compiling process for //DBI// has now been tested successfully, but nothing more: not tested that the plugs run after compiling up DBI in this way on a machine that didn'used to have DBI.+     * **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://wiki.greenstone.org/doku.php?id=en:user_advanced:greenstonesqlplugs#building_the_dbdmysql_package_for_mac_os_v_1013_high_sierra | Building the DBD (and DBI) perl packages]]. Compiling DBD and the Greenstone SQL plugs' use of it were already tested for the Mac. The compiling process for //DBI// has now been tested successfully, but nothing more: not tested that the plugs run after compiling up DBI in this way on a machine that didn'use to have DBI.
  
 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 67: Line 70:
  
   * 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, you can use the commandline and run (incremental-)import and (incremental-)build normally:\\ <code>import.pl -site <SITENAME> <COLNAME>   * 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, you can use the commandline and run (incremental-)import and (incremental-)build normally:\\ <code>import.pl -site <SITENAME> <COLNAME>
-buildcol.pl -activate -site <SITENAME> <COLNAME></code>Or if building incrementally:<code>incremental-import.pl -incremental -site <SITENAME> <COLNAME>+buildcol.pl -activate -site <SITENAME> <COLNAME></code>where COLNAME is the collection name.\\ Or if building incrementally:<code>incremental-import.pl -incremental -site <SITENAME> <COLNAME>
 incremental-buildcol.pl -activate -site <SITENAME> <COLNAME></code>Alternatively, you can run both import and buildcol steps in one go:<code>full-rebuild.pl -site <SITENAME> <COLNAME></code>And if incrementally building in one go:<code>incremental-rebuild.pl -site <SITENAME> <COLNAME></code>\\ **IMPORTANT: On Windows**, precede the import and buildcol or rebuild commands with ''perl -S''.\\ The default sitename is ''localsite''. Leave out the ''-site <SITENAME>'' for Greenstone 2. incremental-buildcol.pl -activate -site <SITENAME> <COLNAME></code>Alternatively, you can run both import and buildcol steps in one go:<code>full-rebuild.pl -site <SITENAME> <COLNAME></code>And if incrementally building in one go:<code>incremental-rebuild.pl -site <SITENAME> <COLNAME></code>\\ **IMPORTANT: On Windows**, precede the import and buildcol or rebuild commands with ''perl -S''.\\ The default sitename is ''localsite''. Leave out the ''-site <SITENAME>'' for Greenstone 2.
   * Start your GS3 server if you haven't already and preview your collection.   * Start your GS3 server if you haven't already and preview your collection.
-  * You can now at any time [[#running|run your MySQL client]] **in utf8mb4 mode** then use it to access modify the contents of the SQL database as you wish (such as using SQL statements to mass-edit metadata) and then rebuild the collection with the changed values in effect:+  * You can now at any time [[#running|run your MySQL client]] **in utf8mb4 mode** then use it to access and modify the contents of the SQL database as you wish (such as using SQL statements to mass-edit metadata) and then rebuild the collection with the changed values in effect:
      * But **once you log into MySQL client, always first set the connection to use the ''utf8mb4'' character set** before creating or loading databases and tables:\\ <code>mysql> set names utf8mb4;</code>      * But **once you log into MySQL client, always first set the connection to use the ''utf8mb4'' character set** before creating or loading databases and tables:\\ <code>mysql> set names utf8mb4;</code>
-     * The GreenstoneSQLPlugs create a **database** called ''<SITENAME>'' for GS3 and called ''greenstone2'' for GS2.+     * The GreenstoneSQLPlugs create a **database** called ''<SITENAME>'' for GS3 (which defaults to ''localsite''and called ''greenstone2'' for GS2.
      * Up to 2 **tables** are created for each collection: ''<COLNAME>_metadata'' and ''<COLNAME>_fulltxt'' (note spelling), where hyphens '-' in <COLNAME> are replaced by underscores '_'.      * Up to 2 **tables** are created for each collection: ''<COLNAME>_metadata'' and ''<COLNAME>_fulltxt'' (note spelling), where hyphens '-' in <COLNAME> are replaced by underscores '_'.
  
en/user_advanced/greenstonesqlplugs.1567667516.txt.gz · Last modified: 2019/09/05 07:11 by anupama