code: public static void replaceDatabaseSchema(final App app, final JsonSchema newSchema) throws FrameworkException, URISyntaxException {
  
  		Services.getInstance().setOverridingSchemaTypesAllowed(true);
  
  		try (final Tx tx = app.tx()) {
  
  			for (final SchemaRelationshipNode schemaRelationship : app.nodeQuery(SchemaRelationshipNode.class).getAsList()) {
  				app.delete(schemaRelationship);
  			}
  
  			for (final SchemaNode schemaNode : app.nodeQuery(SchemaNode.class).getAsList()) {
  				app.delete(schemaNode);
  			}
  
  			for (final SchemaMethod schemaMethod : app.nodeQuery(SchemaMethod.class).getAsList()) {
  				app.delete(schemaMethod);
  			}
  
  			for (final SchemaMethodParameter schemaMethodParameter : app.nodeQuery(SchemaMethodParameter.class).getAsList()) {
  				app.delete(schemaMethodParameter);
  			}
  
  			for (final SchemaProperty schemaProperty : app.nodeQuery(SchemaProperty.class).getAsList()) {
  				app.delete(schemaProperty);
  			}
  
  			for (final SchemaView schemaView : app.nodeQuery(SchemaView.class).getAsList()) {
  				app.delete(schemaView);
  			}
  
  			newSchema.createDatabaseSchema(app, JsonSchema.ImportMode.replace);
  
  			tx.success();
  		}
  	}
docs: Replaces the current Structr schema with the given new schema. This
  method is the reverse of createFromDatabase above.
  
  @param app
  @param newSchema the new schema to replace the current Structr schema
  
  @throws FrameworkException
  @throws URISyntaxException