Delete orphaned data
When portal resources are deleted, dependent resources that are stored in a different database domain are not deleted at the same time. These remaining resources are still available for backup scenarios or other production lines that might share the database domain. For example, when an administrator deletes pages, the user customization to the deleted pages are not deleted.
The SLCheckerTool allows you to detect orphaned data that is not needed any more by any of the production lines that share the domain. Use the SLCheckerTool to prepare an XML script for later deletion of the orphaned data by the XML configuration interface. The SLCheckerTool is included in the file wp.db.slchecker.jar.
To delete all orphaned data, include every production line that shares the database domain. Otherwise resources that are still valid in a skipped production line might be unintentionally removed.
To delete the orphaned data...
- Make a backup of all Portal databases.
- cd portal_server_root/bin
- Create a full export including orphaned data of each production line that shares the particular domain using the XML configuration interface and the XML sample file ExportIncludingOrphanedData.xml.
- Find candidates for orphaned data in each production line. Repeat this step for each production line, but specify a different output file for each iteration, otherwise the results will be overwritten....
./slcheckertool.sh --find-candidates -s xml_source_file -d cand_target_file -domain domain_identifier
...where...
- xml_source_file
- Fully qualified path to XML export file that you created in the step for creating the XML export including orphaned data.
- cand_target_file
- Target file. The orphaned data candidates will be saved to that file.
- domain_identifier
- Database domain in which you want candidates to be searched. Valid values are comm for the community database domain, cust for the customization database domain or all for both database domains.
- Identify the orphaned data. Perform this step only once, but with all the candidate files generated by previous step at once, as this step determines the intersection of all result files, that is, the data that are orphaned in all production lines. Use the following parameters:
./slcheckertool.sh --identify-orphans -s cand_source_files_and_directories -d orph_target_file
...where...
- cand_source_files_and_directories
- All files that were generated as cand_target_files by the substep for finding the candidates. If you specify one or more directories with the files, verify these directories contain only candidate files and no other files.
- orph_target_file
- Target file. The identified orphaned data will be saved to that file.
- Generate an XML script file. We can later use that script for deleting the orphaned data. Use the following parameters:
./slcheckertool.sh --delete-orphans -s orph_source_ file -d xml_target_file...where...
- orph_source_ file
- File that was generated as the orph_target_file in the step for identifying the orphaned data.
- xml_target_file
- Specify the target file. This will be the XML script file that contains the information about the orphaned data. We can later use this file to delete the orphaned data.
- Optional. Check whether all production lines were considered during the creation of the XML script file. To do this, review the comment in the file header. The header contains information about all full exports that were used.
- Delete the orphaned data.
To do this, invoke the XML configuration interface with the XML script that you obtained as the xml_target_file with the orphaned data in the step for generating the XML script. You need to invoke the XML configuration interface with the XML script only on one production line that shares the database domain. This will delete the orphaned data for all production lines that share that database domain.
You have removed all orphaned data from the portal database.
Parent topic:
Manage pages, layout, and content
Related concepts
The XML configuration interface
Related reference:
Reference: Sample XML configuration files
Related information
Working with the XML configuration interface