Kentico CMS 7.0 Developer's Guide

Importing a site or objects

Importing a site or objects

Previous topic Next topic Mail us feedback on this topic!  

Importing a site or objects

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

After you export a site or objects using the Export site wizard or Export objects wizard, you can import the content using the Import site or objects wizard. Before you start the wizard, you need to copy your export packages into the application's ~/CMSSiteUtils/Import folder.

 

Importing a site

 

1. Go to Site Manager -> Sites and click Import site or objects.
 
devguide_clip0331
 

2. In the first step of the wizard, you need to choose the import package that you want to import. Packages that are already stored in the in ~/CMSSiteUtils/Import folder are listed in the Import packages listbox.

 

You can upload additional packages to the folder (and hence add them to the list) by clicking UploadPackage Upload package. You can also add the package to the folder manually and then click Refresh (RebuildIndex). Packages can be deleted (both from the list and from the file system) by clicking Delete Delete package.

 

With a package selected, you can choose from the following options:

 

Preselect all items

If selected, all items in the package will be preselected in the next step.

Preselect only new items

If selected, only items that are not already in the database will be preselected.

 

Make the desired selection and proceed to the next step by clicking Next.
 
devguide_clip1152
 

3. Step 2 appears only when importing a site package. If you are importing a package containing only global objects, Step 3 is displayed instead.

 

You have the following two options in Step 2:

 

Import a new site

A new site will be created based on the contents of the package. You need to enter the site's display name, code name and domain name.

Import objects into an existing site

The wizard imports the content of the package into the selected site.

 

Click Next.
 
devguide_clip0333

 

4. In Step 3, select which of the objects from the package will be imported.

 

The tree on the left represents object categories. These reflect the sections of the administration interface under which the objects can be found. Selecting a category opens a set of check boxes in the right part of the screen, allowing you to choose which objects will be imported. Objects that already exist on the target server are marked with an asterisk (*). If you import an existing object, the new version overwrites the current one.

 

Select the root of the tree (All objects) to access the following import settings:

 

Global selection

Load default selection

Preselects all objects based on your choices in Step 1 of the import wizard.

Select all objects

Selects all objects in the import package.

Select only new objects

Selects only those objects that do not exist in the target database (existing objects are unselected).

Deselect all objects

Unselects all objects in the import package.

Import settings

Update site definition

Displayed only when importing to an existing site. If enabled, all settings stored as part of the site object will be updated with those contained in the package. These settings are stored in the Site\cms_site.xml file inside the export package.

Assign all objects to the imported site (recommended)

If enabled, all imported site-related objects will be assigned to the imported site.

Run the site after import

If enabled, the imported site automatically starts once the import process is complete.

Delete incomplete site when import fails

If enabled, partially imported sites are automatically deleted if the import process fails.

Do not import objects where parent object is missing

If enabled, the import process skips any child objects whose parent objects are not found in the import package.

Import tasks (recommend)

If enabled, delete tasks (incremental deployment) included in the package will be performed.

Import files (recommended)

Some database objects are linked with physical files stored on the file system inside the web project. If you check this option, the import process creates all files that are included in the import package.

Import global folders

If checked, the import process includes global files originally exported from the following folders:

 

~/App_Code/Global/

~/CMSGlobalFiles/

~/CMSScripts/Custom/

~/App_Code/Controllers/

~/Controllers/Global/

~/Views/Global/

Import custom assembly files

If enabled, the import process includes custom assembly files bound to notification gateways, payment options, integration connectors, scheduled tasks and smart search indexes included in the import package. Custom assemblies are those whose names do not begin with the CMS. prefix.

Import site folders

If checked, the import process includes site-related files originally exported from the following folders:

 

~/App_Code/<site code name>/

~/App_Data/<site code name>/

~/<site code name>/

~/Controllers/<site code name>/

~/Views/<site code name>/

Log staging synchronization tasks

If enabled, the system logs staging tasks reflecting all changes made by the import. Check this option to synchronize the imported data to other servers connected through Content staging.

Log integration tasks

If enabled, the system logs outgoing integration tasks for all changes made by the import. Check this option if you want to transfer the imported data to a system connected via the System integration bus).

Overwrite system queries

Available only when importing from an older version of Kentico CMS. If checked, the system imports all queries from the package and overwrites the current ones.

 

Important: If the package contains custom queries that you added to the system, it is necessary to have this option enabled.

 

devguide_clip0334

 

5. The following object categories contain extra options that you can set:

 

Automation processes

Import all site specific triggers

If checked, all site specific triggers will be imported, even if the respective processes are not selected. This check-box is only displayed when the import package contains an exported website, not only separate objects. If you are importing to an existing site, this option is deselected by default.

Custom tables

Import custom table data

If checked, custom table records (the actual data stored in the tables) included in the package will be imported together with the respective custom tables. If you are importing to an existing site, this option is disabled by default.

Documents

Import new documents

If enabled, documents included in the import package will be imported.

 

Please note: when importing into an existing site, only new documents can be imported. Modified documents that are already present on the target server will not be overwritten.

Import document histories

If enabled, document histories (i.e. previous versions of documents) will be imported.

Import document relationships

If enabled, document relationships will be imported.

Import document-level permissions

If enabled, document security settings made in CMSDesk -> Content -> Edit -> Properties -> Security will be imported.

Import blog comments

If enabled, blog comments will be imported together with blog post documents.

Import event attendees

If checked, event attendees will be imported together with all imported events.

Import all user personalization

If checked, user personalization of all users will be imported, even for users who are not selected to be imported. If you are importing to an existing site, this option is de-selected by default.

Forms

Import form data

If enabled, forms data included in the package will be imported together with the forms.

Import physical files data

If checked, physical files saved within form records (if there are some) will also be imported.

Forums

Import forum posts

If enabled, forum posts included in the package will be imported together with the forums.

Groups

Import all group memberships

If enabled, user memberships will be imported together with the selected groups.

Message boards

Import board messages

If enabled, board messages included in the package will be imported together with the message boards.

Media libraries

Import media files

If enabled, media files (stored in database) included in the package will be imported together with the media libraries.

Import physical files

If enabled, physical files (stored in the file system) included in the package will be imported together with the media libraries.

Page templates

Import all site specific page template scopes

If checked, site-specific page template scopes will be imported for all page templates, even if a page template itself is not selected to be imported. This check-box is only displayed with page templates in the Global section of the tree and only when the import package contains an exported website, not only separate objects. If you are importing to an existing site, this option is de-selected by default.

Import web part and zone variants with the selected page templates

If checked, web part and zone variants (from MVT testing or Content personalization) included in the package will be imported together with the selected page templates.

Users

Import user dashboards

Indicates if user dashboards should be imported together with the imported users. If you are importing to an existing site, this option is de-selected by default so that existing dashboards are not overwritten.

Import all user site specific dashboards

If checked, all user dashboards will be imported, even if the respective users are not selected to be imported. This check-box is only displayed when the import package contains an exported website, not only separate objects. If you are importing to an existing site, this option is de-selected by default so that existing dashboards are not overwritten.

Workflows

Import all workflow scopes

If checked, all workflow scopes will be imported, even if the respective workflows are not selected. Import web part and zone variants with the selected page templates. This check-box is only displayed when the import package contains an exported website, not only separate objects. If you are importing to an existing site, this option is deselected by default.

 

6. If you have the Log export tasks option enabled in Site Manager -> Settings -> Versioning & Synchronization -> Staging, a list of tasks may also be displayed under the objects list. This happens when some global objects were deleted (like the two Web part containers in the screenshot below). If you leave the boxes checked, these objects will also be deleted on the target server.

 

devguide_clip0335

 

7. Click Next to execute the import process. An import log appears, showing the progress of the import (you can abort the import process at any time by clicking Cancel).

 

Click Finish. You will be redirected back to Site manager -> Sites.

 

devguide_clip0336

 

 

InfoBox_Note

 

Please note

 

Packages from different versions of Kentico CMS have a different structure. When importing packages from an older version of Kentico CMS to a newer one, the system automatically converts the package to the newer format.

 

Please pay special attention when importing Form control, Inline control and Web part objects from older packages. If possible, avoid overwriting your current objects of these types, as it may cause incompatibility problems.

 

 

Conflicts of running sites

 

If the imported site uses the same domain name or alias as one of the websites already running in your system, the import displays a warning at the end and the imported site does not start.

 

devguide_clip0337

 

In such cases, you need to:

 

1.Go to Site Manager -> Sites.

2.Edit (Edit) the imported site and change the conflicting Site domain name or Domain alias.

3.Return to the list of sites and click Start site (Run) next to the imported site.

 

 

InfoBox_Exclamation

 

Application restart

 

If you get the following error message at the end of the import process:

 

"Application has been restarted and the logging of the import process has been terminated. Please see context help in this section for more details and how to solve this issue."

 

you need to finish the import process manually:

 

1. Open the import package and extract all content of the <package>\Data\Files folder.

 

2. Remove the .export extension from the names of all files in all extracted sub-folders.

 

3. Rename all folders named ##SITENAME## to the code name of the target website and copy them to the root of the web project.

 

4. Copy all contents of the cms_attachments folder (if it is present among the extracted folders) to the location in the target project where document attachments are stored (as configured in Site Manager -> Settings -> System -> Files). Please note that this is applicable only when the system is configured to store document attachments in the file system (not in the database).

 

5. Copy the content of all folders named as an object type (e.g. cms_avatar, cms_documenttype, forums_forum, etc.) to the root of your web project.

 

 

Re-signing imported macro expressions [requires hotfix 7.0.9 or newer]

 

The system uses signatures to ensure the security of macro expressions. The signatures are only valid in the environment of the application where the macros were originally saved.

 

To ensure that macros inside the data of imported sites or objects work correctly, you need to re-sign the macros using the Site Manager -> Administration -> System -> Macros interface. See Macro security for additional information.