lemonldap-ng/doc/sources/admin/changesessionbackend.rst

53 lines
1.7 KiB
ReStructuredText
Raw Normal View History

2020-05-14 23:29:41 +02:00
How to change session backend
=============================
LemonLDAP::NG provides a script to change session backend. This script
will help you transfer existing persistent sessions (or offline
sessions) when migrating from one backend to another, or when adding
indexes to a
2020-05-18 09:56:39 +02:00
:doc:`browseable session backend</browseablesessionbackend>`. It is
2020-05-14 23:29:41 +02:00
available in LemonLDAP::NG utilities directory (``convertSessions``).
How it works
------------
The ``convertSessions`` utility requires you to create a job
configuration file with the following content:
::
# This example migrates psessions from the default File backend to a PostgreSQL database
[sessions_from]
storageModule = Apache::Session::File
2021-03-15 22:45:19 +01:00
storageModuleOptions = { \
'Directory' => '/var/lib/lemonldap-ng/psessions', \
'LockDirectory' => '/var/lib/lemonldap-ng/psessions/lock', \
2020-05-14 23:29:41 +02:00
}
# Only convert some session types
# sessionKind = Persistent, SSO
[sessions_to]
storageModule = Apache::Session::Browseable::Postgres
2021-03-15 22:45:19 +01:00
storageModuleOptions = { \
'DataSource' => 'DBI:Pg:database=lemonldapdb;host=pg.example.com', \
'UserName' => 'lemonldaplogin', \
'Password' => 'lemonldappw', \
'Commit' => 1, \
'Index' => 'ipAddr _whatToTrace user', \
'TableName' => 'psessions', \
2020-05-14 23:29:41 +02:00
}
2021-01-05 17:06:24 +01:00
Invocation
2020-05-14 23:29:41 +02:00
----------
``convertSessions -c job.ini``
Options:
- ``-c``: job configuration file (mandatory)
2021-03-30 12:11:08 +02:00
- ``-r oldkey=newkey``: rename session keys during conversion (optional, can be given multiple times)
- ``-x key``: remove session keys during conversion (optional, can be given multiple times)
2020-05-14 23:29:41 +02:00
- ``-i``: ignore errors. By default errors will stop the script
execution
- ``-d``: print debugging output