Koha Test Wiki MediaWiki Postgres

One of a series of test instances for migrating the Koha Wiki MediaWiki database.

For the current Koha Wiki, visit https://wiki.koha-community.org .

User:Victor Grousset - tuxayo/Development/Tools and operations

From Koha Test Wiki MediaWiki Postgres

Jump to: navigation, search

Contents

Interactive Perl shell - REPL (Read–Eval–Print Loop) with Devel::REPL

Install and run

sudo apt install libdevel-repl-perl
re.pl

Usage example

use Number::Format;
my $format = new Number::Format(-decimal_point => '.');
# $Number_Format1 = Number::Format=HASH(0x39cbf00);
$format->unformat_number("12345,89");
# 12345.89
 
# Caveat: don't use print if you want to see the value, otherwise you will get some kind of return value of print
$ print $format->unformat_number("12345,89");
# 1

Trigger the installer, reset from populated DB

koha-testing-docker has an autopopulated DB

echo "DROP DATABASE koha_kohadev; CREATE DATABASE koha_kohadev;" | koha-mysql kohadev
restart_all

Install translations

https://wiki.koha-community.org/wiki/Installation_of_additional_languages_for_OPAC_and_INTRANET_staff_client

update dababase

~/src/installer/data/mysql/updatedatabase.pl

Reset DB with dump

If you don't have a devbox. Using BibLibre's tools (https://git.biblibre.com/biblibre/tools)

# memcached is flushed because if you switched to another version of the code, the old version will be in cache and the updatedatabase won't run
 
echo "flush_all" | nc -q 2 localhost 11211 && \
~/tools/sysop/db_replace.sh --confirm --dump ~/dumps/koha-sample.sql.gz  && \
~/src/installer/data/mysql/updatedatabase.pl  && \
~/tools/zebra/rebuild_full.sh -b -a

Use Elasticsearch

Switch the SearchEngine syspref

Index data

misc/search_tools/rebuild_elasticsearch.pl -v -d

Maybe also

# as root
koha-elasticsearch -v -p 5 --commit 1000 --rebuild kohadev

Test SIP with emulator

https://wiki.koha-community.org/wiki/Koha_SIP2_server_setup#Example

Apply large patches without adding a git remote

wget -q -O- http://git.biblibre.com/biblibre/kohac/commit/457524cef965faf96a9516c17e9e0a8bbdec19aa.patch | git am -3 -

Trigger the installer

echo "DROP DATABASE koha_kohadev; CREATE DATABASE koha_kohadev;" | koha-mysql kohadev ; restart_all

Generate test data

Many patrons

base:

SELECT surname, firstname, branchcode, categorycode
  FROM
    (
      SELECT surname
        FROM borrowers
       ORDER BY rand()
    ) a,
    (
      SELECT firstname
        FROM borrowers
       ORDER BY rand() ) b,
    (
      SELECT branchcode
        FROM borrowers
       ORDER BY rand() ) c,
    (
      SELECT categorycode
        FROM borrowers
       ORDER BY rand() ) d
 LIMIT 50000

Send emails

Setup email using your own SMTP server.

edit koha-conf.xml to add the following inside the <config> section

 <smtp_server>
    <host>yourSMTP.example.org</host>
    <port>587</port>
    <timeout>5</timeout>
    <ssl_mode>STARTTLS</ssl_mode>
    <user_name>youraddress@example.org</user_name>
    <password>yourpassword</password>
    <debug>1</debug>
 </smtp_server>

A set KohaAdminEmailAddress to your address.

See also

Personal tools