Maintenance Commands


Maintenance commands are tools for typical administrative tasks to be performed on the server. They offer best performance and support bulk operations. The available maintenance commands implemented in the integrated REST server are listed in the table below and can be executed by making a HTTP POST request to the maintenance resource, followed by the command name.

POST /structr/rest/maintenance/clearDatabase '{}'

or with parameters:

POST /structr/rest/maintenance/rebuildIndex '{"type": "Page", "mode": "nodesOnly"}'

importGistImport an AsciiDoc document with included Cypher statements, also known as "GraphGist". The Cypher statements will be executed, the text portions are ignored. After importing the document, Structr runs a schema auto-detection process to analyze the data created via Cypher and infer a data model.
importRdfImport an RDF document. After importing the document, Structr runs a schema auto-detection process to analyze data created based on the imported RDF document and infer a data model.
rebuildIndexRebuild the internal fulltext, keyword and spatial indexes. Takes three optional parameters: type to limit the execution to a certain node type, relType to limit to a certain relationship type, and mode (can be nodesOnly or relsOnly to rebuild the index only for nodes or relationships.
rebuildIndexForTypeRebuild indexes for the specified type only.
createLabelsCreate node labels. Takes an optional parameter type to specify a type to limit creation of labels to this node type.
clearDatabaseEmpty the database.
fixNodePropertiesTries to fix properties in the database that have been stored there with the wrong type.
setNodePropertiesBulk command to set property values on all nodes of a certain type.
changeNodePropertyKeyBulk command to migrate property names.
setRelationshipPropertiesBulk command to set relationship property values on all relationships of a certain type.
copyRelationshipPropertiesBulk command to copy relationship property values.
deleteSoftDeletedNodesBulk command to remove nodes flagged with the deleted boolean attribute.
setUuidBulk command to set UUIDs on all nodes and relationships which don't have an id attribute yet.
syncSynchronize graph data between Structr instances.
snapshotCreate a schema snapshot and write it to a local file on the server the Structr instance is running on.
flushCachesFlush second-level caches.
moveUnusedFilesMove files not referenced by a database node to a target directory. Takes two optional parameters: mode (can be log or move) and target which can be an absolute or a relative path (relative to the standard files/ directory). Default (without parameters) is log only. It is recommended to issue a rebuildIndex command first to be sure that unused files are detected correctly.


About this article
Last change 2016-03-04
Topics RESTServerStructr 2.0