Export and deploy database changes

When you update a data structure on your local development machine, you can export the changes and then automatically import them on the next development environment from the continuous delivery process.

For example, if you update a dynamic module or add a custom field to a static module, you can export all changes. Sitefinity CMS saves them in a folder on the file system. After you transfer the folder to the next environment, upon initialization, Sitefinity CMS automatically applies all the changes.

PREREQUISITES: You have setup the Deployment mode.

Exported strusture

When you export changes to data structure, Sitefinity CMS exports the following:

  • Dynamic module structure, configurations, taxonomies applied to dynamic content types, and dynamic module widget templates
  • Custom fields of static modules, configurations, taxonomies applied to static module content items, any changes to default widget templates or newly created widget templates.

    NOTE: Supported static modules are: News, Events, Lists, Blogs, and Libraries.

  • Custom fields, configurations, and taxonomies applied to Pages.
  • Web services
  • Websites, association of website and modules.
    Websites are included in the deployment package, only if they are marked for deployment.
    For more information, see Deployment mode of websites.
  • Content providers for modules.
  • User profiles 
    The export includes any created custom profile types and any custom fields added to the Basic profile type.

IMPORTANT: Not exported: Associations between sites and providers.

Procedure

After you make a change in a data structure that you want to transfer to the next environment, perform the following:

  1. In Sitefinity CMS backend, navigate to Administration » Export / Import.
  2. In the left pane, click Export for deployment.
    You can see the folder where data structures will be exported to.
  3. Click Export.
    All changes are exported in folder ~\AppData\Sitefinity\Deployment. Inside, Sitefinity CMS creates a separate folder for each module.
  4. Transfer the content of the folder to the next environment and place it in the same folder.

RESULT: When Sitefinity CMS starts on the next environment, it checks the content of folder ~\AppData\Sitefinity\Deployment. If any changes have been made to the files in the folder since the last Sitefinity CMS restart, Sitefinity CMS applies the changes uploaded in the folder. Sitefinity CMS checks, if there is difference in the names, sizes, or date modified of the files.

NOTE: The Deployment folder also includes any changes that you made to the modules that are coming from the add-on. For example, if you have a dynamic module that has been installed on your development environment with an add-on and, afterwards, you add a custom field to this module, the custom field is transferred to the next environment via the Deployment folder, not in the AddOns folder. For more information, see Install and activate add-ons.

Settings

In Administration » Settings » Advanced » Packaging, you can make the following setting to the packaging module:

  • Set the deployment mode
    For more information, see Deployment mode.
  • In DeleteModulesIfNotInPackage, you can specify whether the physical deletion of a dynamic module’s folder from the export folder will delete the module from Sitefinity.
    This setting is deactivated by default.

EXAMPLE: If you export the changes to data structures, for each module, Sitefinity CMS creates a separate folder in the export folder. If you then transfer the export folder to the next environment, enable this setting on the next environment, and delete a module from the folder, Sitefinity CMS will delete the dynamic module from the system.

Was this article helpful?