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 data structure

When you export an updated 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: Associations between sites and providers are not exported.

Procedure

After you make a change to 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

Navigate to Administration » Settings » Advanced » Packaging and (optionally) 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 the system.
    This setting is deactivated by default.

    IMPORTANT: The setting only applies to deleted modules but deleted types within a managed module are always deleted and the respective tables are dropped. Deleting types may result in data loss during development. 

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.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?