Lesson 5.5: Comparing a package with the site and importing single items
Installing a content package on a site that already has content used to be a leap of faith. Compare shows, item by item, how a package differs from the site, and lets you import only what you choose, after a confirmation that lists exactly what will change. This lesson changes an item on the lab after exporting it, then compares and brings back one value from the package.
At a glance
| Course | Multisite and site packages |
| Module | Module 5: Site packages |
| Duration | 50 minutes (15 presenting, 35 exercise) |
| Level | Advanced |
| Audience | Administrators |
| Prerequisites | Lesson 5.3: the package clubb_content exists |
Learning objectives
After this lesson, learners can:
- open the comparison of a package and read its five statuses;
- filter, sort and search the comparison and open one item side by side;
- import one value of a changed item and keep the others as the site has them;
- state the importer's rules: nothing only on the site is removed, locations are never duplicated or moved.
Trainer's notes
How to present it
Source: Look inside a package, compare it with your site, import single items.
- How items are matched (4 minutes). Content classes by identifier, content objects by remote ID. Both sides are serialized by the same code, then normalized per datatype (rich text as canonical XML, relations by remote IDs, images and files by name, size and checksum). Translations only on one side and placement are compared too.
- The statuses (3 minutes). new, changed, only on the site, identical, class missing: each a chip with its own glyph and label, so color is never the only signal; the chips also filter.
- One item (3 minutes). Values side by side, removed text struck through, added text underlined, rich text XML at hand. Compare again rebuilds the cached comparison.
- Importing (5 minutes). With
package/installon top ofpackage/read, rows that are not identical have Import and a checkbox, next to Import selected and Import all changes of this filter; an open item has Import this item and a tick per value. Every import leads to a confirmation that lists what will be set and kept. The rules: a new object is created where the package places it; a changed object gets the package's values, unticked values keep the site's; locations the site has are never duplicated or moved; something only on the site is never removed.
Common questions
Does Compare change anything? No. It is read-only; nothing is installed or stored, only a cached comparison in the cache directory.
Why is an item refused? An object that is not published, whose class differs, or that has no values is refused before the confirmation, with the reason.
How many items per request? At most 25; the result page offers the next step when a filter holds more.
What about classes? A changed class is updated in place; an object whose values need a class imported first is imported together with that class, listed first in the confirmation.
Pitfalls
- Comparing a site package. Compare is for packages that install content; a site package has nothing to install on its own.
- Unpublished drafts. An object changed only as a draft compares as the published version.
- Importing everything. Import all changes of this filter with no filter imports every difference; filter first.
Hands-on exercise
Use your training installation and an administrator account, with the package clubb_content from lesson 5.3.
- In the administration, edit the folder News below Site B: change its name to
News and eventsand publish. - Open Setup > Packages, open
clubb_contentand press Compare. - Read the counts of each status. Which items are identical, which changed?
- Filter by changed. Open the item News and events.
- Read the values side by side: the old name from the package and the new one on the site.
- Press Import this item, untick every value except the name, and continue to the confirmation.
- Read the confirmation: what will be set, what kept.
- Confirm. Read the result.
- Open the folder in the administration: its name is
Newsagain. Open Manage versions and see the new version the import made. - Back in the comparison, press Compare again: the item is identical now.
Expected result
- Step 3: most items identical, the folder changed.
- Step 7 lists the name as set and the other values as kept.
- Step 9: the folder is called News, in a new version; nothing else on the site changed.
- Step 10: the comparison shows the item identical.
- The trainer checks step 7 on the projector before learners confirm.
Quiz
- How are content objects of a package matched to the site?
- Which status does an object have that exists on the site below the package's top node but not in the package? A. new B. changed C. only on the site D. class missing
- True or false: importing a package removes objects that exist only on the site.
- You untick a value in Import this item. What happens to it?
- Which policies are needed to import?
Answers
- By remote ID (Package compare and import).
- C.
- False. Something only on the site is never removed.
- It keeps the site's value.
package/installon top ofpackage/read.
Further reading
- Look inside a package, compare it with your site, import single items.
- Packages, 3. A package's page.
- Versions of an object.
Related pages
- Module 5: Site packages
- Multisite and site packages: course overview
- Trainers: start here
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.