Mura Site Bundles Part 1: Create a Bundle
June 11, 2015 by Michael Evangelista
One of Mura's most robust features is the automated "Site Bundle" system. A Mura site bundle is a specially-formatted .zip file with a collection of content and file assets used to duplicate an entire Mura CMS site. A site created from a site bundle includes all of the content and design aspects of the original, including all pages, theme files and other assets, with settings to control what actually gets imported when the bundle is deployed.
Instant Website, Theme and Content Included
Site Bundles are most commonly used as a means to install and distribute Mura themes. Since the bundle contains all of the file and design assets as well as the site structure, a theme designer can showcase all of the potential features such as photo galleries, multi-level navigation, portfolio layouts, forms, tables and more, by providing Mura pages containing the various layout objects as part of the bundle.
In addition, a site bundle provides a nearly effortless way to take a snapshot of a site in development, or to store a customized base theme for a quick start from the same point on a future project. With all of the site's content, layout files and templates included, a Mura site bundle packages up everything needed to create an identical replica of the site in another location, or even in the same Mura instance.
To learn more about creating custom Mura themes, take a look at the in-depth video series, Theme Development with Mura CMS.
Bundles as Easy Backups
Another common use for Mura's site bundle functionality is the creation of reliable backups of a Mura site. While a Mura installation can usually be replicated from a copy of the web root files and database, using a bundle as a backup provides an extra level of portability. For example, a backup restored from a copy of the site's files and data, such as a hosting provider would commonly offer, has the potential to also include any errors or problems caused by alteration of core files or errant data, including problems caused by other Mura sites in the same instance. On the other hand, a backup restored from a bundle will contain only the files and assets for that specific Mura site, and can be deployed into any Mura instance or even a brand new installation, should circumstances require.
Creating a Bundle
Like most aspects of the Mura content workflow, the site bundle system is controlled with a simple interface available from the Mura admin area.
Selecting the "Create Site Bundle" option from within the Mura Site Manager, the user is presented with a set of clearly labeled controls. While a bundle will always contain the site's content and data structure, optional site bundle contents include version histories, comments and ratings, data submitted through Mura forms and even the site members and administrative users connected to the site.
A bundle may also include any plugins associated with the Mura site, provided the plugin developer has provided the proper hooks for bundling the plugin's files and data.
The final setting in the Create Site Bundle interface determines the location of the resulting .zip bundle file. By default, the .zip file is stored in Mura's admin/temp directory and downloaded automatically to the browser on completion. Alternately, a directory path may be provided, and the .zip file will be stored on the server for later access. This is especially useful when creating a backup bundle, where the resulting file will be stored for safekeeping rather than installed in another location.
The site bundle's .zip file contains a specific internal structure which is written and read by Mura during the Create Bundle and Deploy Bundle routines. While it is not recommended to alter or edit anything within this file, it may be useful to know what it contains.
Within the zip file are a number of .xml documents in "wddx" format. This is a machine-readable xml syntax which stores all of the relevant data used to import the content into specific locations within the Mura CMS database. There is also a nested .zip file contained within the bundle. This is a complete copy of the siteid directory from the Mura web root, including all file and image assets, templates, and themes.
There is generally no need to open or alter the contents of the bundle file. If changes to the exported content are desired, the recommended workflow includes deploying the bundle in its new location and using the Mura Site Manager interface to make the required changes. However, in sites with large numbers of file assets and images it may be advisable to remove the contents of the site's cache or assets directories from the bundle, allowing the import process to complete much more quickly, with the asset or cache directory contents uploaded through FTP after deploying the bundle in Mura's Site Manager.
Also note the special formatting in the name of the bundle file. The date and site name are included in the file name for easy reference and to avoid conflict when storing multiple bundles in a single location.
Additional Content Transfer Options
While bundles are useful for backups and replication of a site's complete content, there are times when a partial duplication or transfer of Mura content, separate from the design aspects, is preferable to a complete copy of the site. For these scenarios, Mura provides a powerful "Export Content" option . This system allows all or any part of a site's content to be copied into a new Mura site, without the design and template files.
Please note, a Mura Site Bundle should not be confused with a "Resource Bundle", which is used to translate Mura's text labels and admin contents into various languages.
Putting It to Work
Whether replicating a site or storing a backup for safekeeping, creating a site bundle is a quick and easy way to make a portable copy of any Mura CMS site. In our next article we will take a look at the multiple uses for installed Mura site bundles, and the options available when deploying a bundle.
With this and any other aspect of Mura CMS development, it is important to be aware of the Mura "Upgrade Path". Making sure your edits and changes are made in the proper places will ensure trouble-free site bundle operations and prevent conflict problems with version updates and other important features.
More About this Feature
Also see Mura CMS v6 Documentation: Deploy a Site Bundle
Free and Premium Mura CMS Themes are available at getmura.com/downloads.
To learn more about the process of Mura CMS theme creation, see the tutsplus.com tutorial series:
Theme Development with Mura CMS.