Brightspot CMS Developer Guide

Database Bootstrap


Using the Database Bootstrap tool, you can export database objects from one Brightspot environment and import them into another environment. The exported data is in a JSON file downloaded to a local drive and then imported into another database.

A package can contain an entire database or data associated with a particular feature or functionality. You can also use the @BootstrapPackage annotation in your model classes to define custom packages based on specific data types.

Viewing Database Bootstrap packages.png Viewing Database Bootstrap packages.png
Viewing Database Bootstrap packages


    Caution
    • This tool is intended to be used between Brightspot environments with the same underlying data model.
    • You set the export and import databases in a configuration file that’s read by the Database Bootstrap tool. For more information, see Database configuration.
    • Before using the tool, identify the dependencies between data types. Dependencies are objects referenced by another object listed in a package. If a package is downloaded and imported without selected dependencies, the relationships between an object and its dependencies will be lost unless the dependent objects are currently stored in the destination database.
    • For entire database migrations between Brightspot projects, the Database Bootstrap tool is used in conjunction with the Storage Item Copy tool, which copies file-based data from one project to another. File-based data that is used in a Brightspot project is referenced by that project’s database.


    To export bootstrap packages:

    1. From the Dari Standard Tools, select Database: Bootstrap.
    2. Under Download Bootstrap Packages, and using the table below as a reference, identify which packages you want to export.
    3. For each package you want to export, do the following:

      1. Click Dependencies to view the associated dependencies. Mark the dependencies you want to include in the export. (If you defined custom packages and specified dependencies with the @Recordable.BootstrapPackages annotation, the dependent data types specified in the annotation appear here.)
        Dependencies.png Dependencies.png
        Dependencies
      2. Click Types to view the data types associated with the package. (If you defined custom packages and specified dependencies with the @Recordable.BootstrapFollowReferences annotation, the dependent data types appear here.)
      3. Click Live Download to download the packages as a compressed JSON file.

    Packages available for export

    Package
    Description
    _init
    Downloads the full database. All dependencies are included.
    Application
    Downloads the application-specific settings only. In Brightspot, this data is set with the dashboard (from the Navigation Menu, select Admin > Sites & Settings).
    Referential Text Markers
    Downloads any text markers created in an instance.
    Sites
    Downloads any multi-site settings.
    Standard Image Sizes
    Downloads all cropped image sizes and internal names.
    Users and Roles
    Downloads all users and roles.
    Workflows
    Downloads all created workflows, transitions, and statuses.

    To import packages:

    1. From the Dari Standard Tools, select Database: Bootstrap.
    2. Under Import Bootstrap Package, click Choose File, and select the JSON file that you exported as described above in Exporting bootstrap packages. (You can select the compressed archive or the decompressed version.)
    3. Set the following options:

      • Delete Before Import: If set, the import job deletes all objects in the destination database that are of the same type as in the JSON file.

        Deletion is solely based on the data types in the source database. The entire destination database is not deleted, unless, of course, you export with the _init option. For example, if an export file consists of only Article objects, then only objects of type Article are first deleted in the destination database before the import operation starts.

        If this option is not set, no deletion occurs to the destination database. However, the tool overwrites objects with the same IDs as objects in the source database.

      • # of Writers: The number of database writer tasks to run in the background.
      • Commit Size: The number of pending commits to write to the database.
    4. Click Import.

    You can monitor the import job's process. For details, see Task Status.

    Previous Topic
    Code Playground
    Next Topic
    Database bulk operations
    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