restauth-import man page

restauth-import — import data into RestAuth


restauth-import.py [-h] [--gen-passwords] [--overwrite-passwords]
[--overwrite-properties] [--skip-existing-users]
[--skip-existing-groups] [--using ALIAS] [file]


restauth-import.py can be used to import data into RestAuth using a specially formatted JSON file. Please see restauth-import(5) for a description of how exactly the data must be formatted.


restauth-import.py by default imports the data as is and does not overwrite any already existing data. Various options allow you to configure if specific kinds input data should take precedence over whats already in the RestAuth database.

If you don't specifiy file, restauth-import.py reads from standard input.


restauth-import.py import.json

Simply import the data in the file import.json. If data already exists in the local service, it will be ignored. This means:

passwords will only be used if the user didn't exist before.
properties that already exist will be ignored.
group memberships are added.

restauth-import.py --gen-passwords import.json

Import data and generate new passwords for new users (or services) that don't have a password in the input data.

restauth-import.py --overwrite-passwords --overwrite-properties import.json

Import data and overwrite passwords of already existing users. Also set properties that already exist to the new value found in the input data.

restauth-import.py --skip-existing-users --skip-existing-groups import.json

Skip users or groups that already exist alltogether. Properties won't be used even if they weren't set before, memberships to groups are not added if the group previously existed.

Available Parameters

-h, --help
show this help message and exit
Generate passwords where missing in input data and print them to stdout.
Overwrite passwords of already existing services or users if theinput data contains a password. (default: False)
Overwrite already existing properties of users. (default: False)
Skip users completely if they already exist. If not set, passwords and properties are overwritten if their respective --overwrite-... argument is given.
Skip groups completely if they already exist. If not set, users and subgroups will be added to the list.
--using ALIAS
Use different database alias. (UNTESTED!)

Influential Environment Variables

The path to the Django settings module. If not set, RestAuth.settings is used, which should be fine in most cases. For more information, please read the Django documentation.
A semi-colon (';') seperated list of additional directories to search for python modules. The RestAuth installation must be in the module search path for any commands to work. For more information, please read the official python documentation.

See Also

The input data format used by this script: restauth-import(5)

Other scripts: restauth-service(1), restauth-user(1), restauth-group(1)


Mathias Ertl

Referenced By

restauth-group(1), restauth-manage(1), restauth-service(1), restauth-user(1).

Explore man page connections for restauth-import(1).

RestAuth 0.6.3 February 05, 2016