References

Maintenance Commands

Maintenance commands perform administrative operations on the database and application. They run with full privileges and are available only to admin users. You can execute maintenance commands through the Admin UI (Schema → Admin menu), the REST API (POST /structr/rest/maintenance/<command>), or programmatically using the maintenance() function. For details on execution methods, see the Maintenance chapter.

changeNodePropertyKey

Migrates property values from one property key to another.

Parameters

NameDescriptionOptional
oldKeySource property keyno
newKeyTarget property keyno

Use this command when you rename a property in your schema and need to move existing data to the new key.

clearDatabase

Removes all nodes and relationships from the database.

Notes

copyRelationshipProperties

Copies property values from one key to another on all relationships.

Parameters

NameDescriptionOptional
sourceKeySource property keyno
destKeyDestination property keyno

createLabels

Updates Neo4j type labels on nodes to match their Structr type hierarchy.

Parameters

NameDescriptionOptional
typeLimit to nodes of this typeyes
removeUnusedRemove labels without corresponding types (default: true)yes

Use this command after changing type inheritance or when labels are out of sync.

The command reads each node’s type property, resolves the inheritance hierarchy, and creates a label for each type in the chain.

Notes

deleteSpatialIndex

Removes legacy spatial index nodes from the database.

Deletes all nodes with bbox and gtype properties.

Notes

deployData

Exports or imports application data.

Parameters

NameDescriptionOptional
modeimport or exportno
sourceSource folder path (required for import)yes
targetTarget folder path (required for export)yes
typesComma-separated list of types to exportyes

Exports or imports data only, not the schema or application structure. Use this for backing up or migrating data between environments.

deploy

Exports or imports a Structr application without data.

Parameters

NameDescriptionOptional
modeimport or exportno
sourceSource folder path (required for import)yes
targetTarget folder path (required for export)yes
extendExistingAppIf true, import merges with existing application instead of replacing ityes

Exports or imports the schema, pages, files, and security configuration. The export creates a text-based format suitable for version control.

This is the same mechanism used by the Dashboard deployment feature.

directFileImport

Imports files from a server filesystem directory into Structr’s virtual filesystem.

Parameters

NameDescriptionOptional
sourceSource directory path on the serverno
modecopy (keep originals) or move (delete after import)no
existingHandle duplicates: skip, overwrite, or rename (default: skip)yes
indexEnable fulltext indexing for imported files (default: true)yes

Notes

fixNodeProperties

Converts property values that were stored with an incorrect type.

Parameters

NameDescriptionOptional
typeNode type to fixno
nameSpecific property to fix (default: all properties)yes

Use this command after changing a property’s type in the schema, for example from String to Integer.

flushCaches

Clears all internal caches.

Use this command to reduce memory consumption or resolve cache invalidation issues.

letsencrypt

Creates or renews an SSL certificate using Let’s Encrypt.

Parameters

NameDescriptionOptional
serverstaging (test certificates) or production (valid certificates)no
challengeOverride the challenge method from structr.confyes
waitSeconds to wait for DNS or HTTP challenge preparationyes
reloadReload HTTPS certificate without restart (default: false)yes

Notes

maintenanceMode

Enables or disables the maintenance mode.

Parameters

NameDescriptionOptional
actionenable or disableno

When the maintenance mode is started, the following services are shut down:

After a short delay, the following services are restarted on different ports:

Notes

rebuildIndex

Rebuilds database indexes by removing and re-adding all indexed properties.

Parameters

NameDescriptionOptional
typeLimit to this node typeyes
relTypeLimit to this relationship typeyes
modenodesOnly or relsOnlyyes

Use this command after bulk imports or when search results are inconsistent.

setNodeProperties

Sets property values on all nodes of a given type.

Parameters

NameDescriptionOptional
typeNode type to modifyno
newTypeNew value for the type propertyyes

All parameters except type and newType are treated as property key-value pairs to set on matching nodes.

Notes

setRelationshipProperties

Sets property values on all relationships of a given type.

Parameters

NameDescriptionOptional
typeRelationship type to modifyno

All parameters except type are treated as property key-value pairs to set on matching relationships.

Notes

setUuid

Generates UUIDs for nodes and relationships that lack an id property.

Parameters

NameDescriptionOptional
typeLimit to this node typeyes
relTypeLimit to this relationship typeyes
allNodesApply to all nodesyes
allRelsApply to all relationshipsyes