Brightspot CMS Developer Guide

Database bulk operations


You can employ bulk operations for databases in Brightspot. This section explains the bulk operations available to you.


The indexed methods annotation instructs Dari to index a field. Applying this annotation does not retroactively index already existing data; it only ensures that future data will be indexed.

To reindex existing data, use the Index tool. You can re-index on a single type or all types. If you select all types, all database records, regardless of visibility label, will be reindexed. However, if you select a specific type, only visible records will be reindexed.

Records being reindexed are queried for using resolveToReferenceOnly, so any indexed methods which depend on values in referenced (non-embedded) records will not be calculated correctly. You can work around this issue by explicitly resolving the references in the indexed method, or by writing your own reindexing task.

When you start the reindex process, a link appears to the background task that reindexes existing objects. Click the link to monitor the background task.

Note
When importing a new or updated database, Solr will also need to be indexed, which you can do with the Index tool.

Database - Bulk Operations.png Database - Bulk Operations.png
Database - Bulk Operations


Use the Copy tool to copy data from one database to another. The Copy tool is often used when a new MySQL database is added and the Solr database needs to be created. Copying SQL to Solr populates the Solr database with the SQL data.

Dari Copy tool.png Dari Copy tool.png
Dari Copy tool

Another use case is to resynchronize databases that are no longer in sync.

You can copy records from a single type or records of all types. If you select all types, all database records, regardless of visibility label, will be copied. However, if you select a specific type, only visible records will be copied.

If you select Delete before copy, all of the records of the selected type will be deleted from the destination database before beginning the copy. You will probably want to select this if you just loaded a fresh MySQL database, or if you are resynchronizing the databases. If you do not select this option in these cases, queries could return inconsistent data depending on which database is queried.

The records are saved to the destination database using saveUnsafely, so the save life cycle will not be triggered. For more information, see Save life cycle.

Previous Topic
Database Bootstrap
Next Topic
Database Query
Was this topic helpful?
Thanks for your feedback.
Our robust, flexible Design System provides hundreds of pre-built components you can use to build the presentation layer of your dreams.

Asset types
Module types
Page types
Brightspot is packaged with content types that get you up and running in a matter of days, including assets, modules and landing pages.

Content types
Modules
Landing pages
Everything you need to know when creating, managing, and administering content within Brightspot CMS.

Dashboards
Publishing
Workflows
Admin configurations
A guide for installing, supporting, extending, modifying and administering code on the Brightspot platform.

Field types
Content modeling
Rich-text elements
Images
A guide to configuring Brightspot's library of integrations, including pre-built options and developer-configured extensions.

Google Analytics
Shopify
Apple News