Overview of migration solutions
-------------------------------

This page collects scripts/plugins/etc. that can export data of an existing service into the
:doc:`import data format </migrate/import-format>`. This list is not intended to be complete, but if
you know of additional solutions, just :doc:`contact </developer/contribute>` us and we will add it
to the list.

htpasswd files
==============

``htpasswd`` files are generated by the Apache webserver (most commonly the ``htpasswd`` command)
and are used for basic access authentication.

The script found in the ``htpasswd`` directory of the :ref:`migration_repository` converts such
files into the :doc:`import data format </migrate/import-format>`. It supports passwords encrypted
with the crypt, md5 and sha1 algorithms as well plain-text passwords. Please try:

.. code-block:: bash

   python htpasswd-export.py --help
   
... for usage information.

Linux systems
=============

The script found in the ``linux`` directory of the :ref:`migration_repository` converts Linux system
accounts into the :doc:`import data format </migrate/import-format>`. The script automatically
uses encrypted passwords from ``/etc/shadow`` if available, optionally stores the users login shell
and home directory as properties and optionally adds user groups. By default, system users and
system groups are skipped.

Please try:

.. code-block:: bash

   python linux-export.py --help
   
... for usage information.

.. NOTE:: The script does not touch the hashes found in either ``/etc/passwd`` or ``/etc/shadow``
   and assumes that RestAuth will be able to decrypt them using the :py:func:`~crypt.crypt`
   function. Thus, authentication might not work if :py:func:`~crypt.crypt` on the RestAuth server does not
   support the same hashing algorithms.

MediaWiki
=========

An extension exporting all relevant data into the restauth import data format is available in the
migration repository. Please see `the extension documentation
<https://restauth.net/wiki/MediaWiki#Migrating_Wikis>`_ for more information.

Drupal
======

None yet.

.. _migration_repository:

Migration repository
====================

You can find a git-repository that collects various migration scripts at
`git.fsinf.at/restauth/migration <http://git.fsinf.at/restauth/migration>`_.