8. Management Tasks¶
8.1. Create a new superuser¶
In case you are locked out because you have forgotten the
Login to the shell of your Agora server by an SSH session (if you have lost the SSH password, we can’t help you)
Make sure Agora is running
sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED .... NAMES
xxxxxxxxxxx gtagora-registry.gyrotools.com/gtagora/app:5.2.0 "/entrypoint.sh" 3 weeks ago .... agora_app
xxxxxxxxxxx gtagora-registry.gyrotools.com/gtagora/web:5.2.0 "/entrypoint.sh" 3 weeks ago .... agora_web
xxxxxxxxxxx postgres:9.6 "docker-entrypoint.s…" 3 weeks ago .... agora_db
xxxxxxxxxxx redis:3.0 "docker-entrypoint.s…" 5 weeks ago .... agora_redis
Enter the agora_app container
sudo docker exec -it agora_app bash
root@f5bf25337c86:/app#
Create a new superuser
python /app/srv/manage.py createsuperuser
Open Agora in the browser and login with the newly created user. Now your can’t set a new password for your all account.
Caution
Don’t run the python command by calling docker’s “run” command (sudo docker run -it agora_app ...). This will start a new Agora instance.
8.2. Agora management commands¶
If Agora is running, you can execute the built-in Agora management tool from the host with:
sudo gtagora manage <command> [arguments]
This is a shortcut for running the same command inside the application container:
python /code/manage.py agora <command> [arguments]
The following top-level commands are available:
Command |
Description |
|---|---|
|
Anonymization tools, including repair of partially anonymized exams. |
|
Data consistency checks, for example validation of datafiles. |
|
Cleanup tasks for temporary directories, trash, zombie files, and similar leftovers. |
|
Export Agora elements such as projects, folders, exams, series, and datasets. |
|
Image information tools for inspecting failed entries and updating outdated image info. |
|
Import Agora export archives ( |
|
License tools to check, activate, renew, or inspect the current license. |
|
Log file utilities, including nginx log access configuration and traffic parsing. |
|
Parameter maintenance tools to store, compress, restore, clean up, and refresh parameter names. |
|
Project utilities to display project structure and print or update project statistics. |
|
Manage root paths and generate Apache or nginx configuration for them. |
|
List existing thumbnails or create missing thumbnails. |
|
Timeline maintenance tools, including finishing timeline items in bulk. |
|
Transfer exams, series, datasets, or folders to another Agora instance. |
|
Create the default admin account. |
|
Show the current Agora version. |
The sections below summarize the subcommands that are currently exposed by python manage.py agora.
8.2.1. Command reference¶
8.2.1.1. parameter¶
Parameter maintenance tools.
parameter storeStore parameters from the database to files and reload queued parameter data into the database.
Options:
--reset-status-errorresets the error status of erroneous datasets.--reset-status-allresets the error status of all datasets.--forcerecreates parameter files even if they already exist.--file-onlyonly stores parameters to files.--no-fileonly reloads parameters into the database.
parameter compressSave parameter data to files and compress parameter sets in the database to a minimal format.
parameter restoreRestore full parameter sets in the database from the stored parameter files.
parameter cleanupClean up the parameter database, including duplicate collections and multi-page parameter sets.
Options:
--dry-runreports affected parameter collections without changing the database.
parameter update-namesUpdate stored parameter names for search intellisense.
8.2.1.2. version¶
Show the current Agora version.
Options:
--allprints the version, build time, and changeset.--writewrites the current version information to the database.
8.2.1.3. root_path¶
Manage configured root paths and generate web server configuration for them.
root_path listShow all configured root paths.
root_path create <path>Create a new root path.
root_path update <root_path_id> [--path <path>] [--active <true|false>]Update the location or active state of an existing root path.
root_path delete <root_path_id>Delete a root path.
root_path apache [path]Generate Apache configuration for the configured root paths.
root_path nginx [path]Generate nginx configuration for the configured root paths.
8.2.1.4. user¶
Create the default admin account.
user create_default_adminCreate the default admin user, or set the default password when the account already exists without a password.
Options:
--forcesets the default password even when the admin user already exists.
8.2.1.5. license¶
License maintenance tools.
license checkCheck the current license.
Options:
--localchecks only the local key.
license activate <activation_code>Activate a license with the supplied activation code.
license renewRenew the current local license key.
Options:
--forceforces a renewal attempt.
license currentShow the current license.
license activationfileGenerate the activation file content.
8.2.1.6. logfile¶
Log file utilities.
logfile nginx <path>Write an nginx configuration that exposes the Agora log files.
Options:
--dry-runprints the generated configuration without writing it.
logfile parse-traffic <outfile>Extract HTTP request traffic from the log files for later analysis.
8.2.1.7. cleanup¶
Run cleanup jobs for temporary directories, old trash elements, zombie files, and similar leftovers.
Options:
--dry-runreports actions without deleting anything.--delete-zombiesincludes zombie cleanup jobs that are otherwise skipped.--move-zombie-filesmoves zombie files instead of deleting them.
8.2.1.8. anon¶
Anonymization tools.
anon repairFind and repair partially anonymized exams.
Options:
--project-id <id>restricts the repair to a single project.--yesor-yskips the confirmation prompt.--verboseor-vprints a detailed summary of affected exams.
8.2.1.9. image¶
Image information tools.
image info updateUpdate all outdated image information entries.
image info failedList failed image information entries.
Options:
--copy-files <path>copies the related files to the given directory.
8.2.1.10. timeline¶
Timeline maintenance tools.
timeline finish_allMark started timeline items as finished.
Options:
--project-id <id>processes timeline items for a single project.--user-id <id>processes timeline items for a single user.
At least one of
--project-idor--user-idmust be supplied.
8.2.1.11. thumbnail¶
Thumbnail management tools.
thumbnail list --allthumbnail list --exam <id>thumbnail list --series <id>thumbnail list --dataset <id>List thumbnail paths for all thumbnails or for a selected exam, series, or dataset.
thumbnail create --all [--force]thumbnail create --exam <id> [--force]thumbnail create --series <id> [--force]thumbnail create --dataset <id> [--force]Create missing thumbnails, or recreate them with
--force.
8.2.1.12. export¶
Export Agora objects to .aex archives.
export project <id>export exam <id>export series <id>export dataset <id>export folder <id>Export the selected object.
Common options:
--outdir <path>sets the output directory.--no-dataexports metadata only.--indent <n>sets the JSON indentation level.--compresscompresses the export file.--password <password>encrypts the export file.
8.2.1.13. import¶
Import Agora export archives.
import <filename>Import a
.aex,.aex.gz,.aex.enc, or.aex.gz.encarchive.Options:
--project <id>imports into the selected project.--project-name <name>overrides the imported project name.--folder <id>imports into the selected folder.--user <id>imports as the selected user id.--username <name>imports as the selected username.--dry-runvalidates the archive without importing it.--forceimports even if the data already exists.--password <password>decrypts an encrypted archive.
Automatic schema migration
Each
.aexarchive records the AEX schema version and the set of Django migrations that were applied when it was created. When importing an archive that was exported from an older version of Agora, the import pipeline automatically replays the relevant schema changes (added fields, removed fields, renamed fields and models) against the JSON data inside the archive before handing it to the normal import logic. This means archives created with earlier versions of Agora can be imported without manual intervention.The following migration operations are applied automatically:
AddField — missing fields are filled with the field’s default value or
null.RemoveField — keys not present in the current schema are stripped.
RenameField / RenameModel — keys and filenames are updated to match the current names.
Operations involving arbitrary Python or SQL (
RunPython,RunSQL) cannot be replayed automatically and are skipped with a warning. If a migration of this type affects data that is present in AEX archives, a manual AEX migration must be provided in the Agora source.
8.2.1.14. project¶
Project maintenance tools.
project statistics updateUpdate project statistics.
Options:
--id <project_id>limits the update to one project.--only-outdatedonly updates outdated statistics.
project statistics printPrint project statistics.
Options:
--id <project_id>limits output to one project.--outfile <path>writes the statistics as JSON.--lightprints a faster, reduced version of the statistics.
project display <project_id>Print the folder and exam structure of a project on the command line.
Options:
--depth <n>limits the folder tree depth.
8.2.1.15. check¶
Consistency checks for stored data.
check datafilesCheck whether referenced datafiles exist on disk and report zombie datafiles.
Options:
--no-zombiesskips the zombie datafile check.--no-filesskips the on-disk file existence check.
8.2.1.16. transfer¶
Transfer Agora objects to another Agora instance.
transfer exam <id> <url> <target-project-id>transfer series <id> <url> <target-project-id>transfer dataset <id> <url> <target-project-id>transfer folder <id> <url> <target-project-id>Transfer the selected object to another Agora instance and target project.
Common options:
--api-key <key>authenticates with an API key.--username <name>authenticates with a username.--password <password>authenticates with a password.--target-path <path>places the transferred object below the given target path on the destination instance.