--- gitea: none include_toc: true --- [PHP Settings](atom-settings.md) --- # AtoM CLI https://www.accesstomemory.org/en/docs/2.8/admin-manual/maintenance/cli-tools/#maintenance-cli-tools ## get version of AtoM ``` php symfony tools:get-version or /usr/bin/php7.2 symfony tools:get-version ``` ## Set all draft to published ``` UPDATE status SET status_id=160 WHERE type_id=158 AND object_id <> 1; ``` and then rebuild search index! ## Clear cache ``` sudo -u www-data php symfony cc ``` ## Restart memcache ``` systemctl restart memcached.service ``` ## Restart php ``` systemctl restart php7.2-fpm.service ``` ## Search Status ``` php symfony search:status ``` ## Populate search index ``` sudo -u www-data php symfony search:populate For Production: sudo -u www-data php symfony search:populate --update ``` ## Build nested set ``` sudo -u www-data php symfony propel:build-nested-set ``` ## Generate Slugs ``` sudo -u www-data php symfony propel:generate-slugs ``` ## Delete all Jobs ``` sudo -u www-data php symfony jobs:clear ``` ## AtoM Worker Live Log ``` journalctl -f -u atom-worker ``` ## restart worker ``` sudo systemctl reset-failed atom-worker ``` ## Add SuperUser account ``` sudo -u www-data php symfony tools:add-superuser --email="youremail@example.com" --password="MYSUPERPASSWORD" ``` ##Delete DB löscht alle Einträge in den Tables. DB und Tables bleiben bestehen. ``` sudo -u www-data php symfony propel:insert-sql ``` ## Delete Archival Description and its digital objects objects first: ``` sudo -u www-data php symfony digitalobject:delete --and-descendants ``` archival descriptions: ``` sudo -u www-data php symfony tools:delete-description -B ``` ## Delete all drafts ``` sudo -u www-data php symfony tools:delete-drafts ``` ## delete all physical storage in AtoM that is not linked ``` php symfony physicalobject:delete-unlinked ``` ## Import CSV Archival descriptions ``` sudo -u www-data php symfony csv:import /home/administrator/atom-import-who-isad-2.6_definitiv.csv --index --update="delete-and-replace" ``` Physical Storage ``` php symfony csv:physicalobject-import /path/to/storage.csv ``` ## Update CSV - Export of https://adchio2941.xyz.org/index.php/x5cp-w5q6-9z53 as CSV using the clipboard - Adding/changing fields, like scope and content - Import CSV using "update" and checking "skip unmatched records". - So far, we did not have a match for the top element "Mihaiela test", and the following link tells us why: https://www.accesstomemory.org/de/docs/2.7/user-manual/import-export/csv-import/#csv-descriptions-match-criteria ### Matching criteria 1: legacyID and source_name.=== - legacyID was there in the CSV - source_name was not. This is because `x5cp-w5q6-9z53` / Mihaiela test was not imported from an external source but originally created in AtoM. so then the next matching criteria would be used. ### Matching criteria 2: title, repository, identifier=== - title was there in the CSV. - repository was not in the CSV, because `x5cp-w5q6-9z53` was not bound to a repository. I added it to "Test area for import" - identifier was not in the CSV, because it had none. I added random number `8805` to this field. After my changes, I exported the CSV again, now with the nescessary data. Then changed "scope and content" and imported/updated as described before, and now it worked. So you should make sure, one of the 2 matching criteria groups are given. There is a `--roundtrip` version of the import command, which only checks for the `legacyID` to be a match. But this is only available on command line, not in the GUI. ## Regenerate Derivatives ``` sudo -u www-data php symfony digitalobject:regen-derivatives ``` ## curl ### create login cookie and query using the API ``` curl -k --max-time 30 --retry 50 --retry-delay 5 -c cookie_atom55555.txt -u "uuu:xxx" -X POST -d "email=support@docuteam.ch" -d "password=xxx" https://55555atom-cosmos.docuteam.cloud/user/login curl -k --max-time 30 --retry 50 --retry-delay 5 -o result.txt -b cookie_atom55555.txt -u "uuu:xxx" --get -d "sq0=_c8434040-f2aa-4b6d-bc63-453e63bf5af7" https://55555atom-cosmos.docuteam.cloud/api/informationobjects ```