Add restoreDeletedCategory.php script for comprehensive category restoration#13926
Open
MosheMaorKaltura with Copilot wants to merge 5 commits into
Open
Add restoreDeletedCategory.php script for comprehensive category restoration#13926MosheMaorKaltura with Copilot wants to merge 5 commits into
MosheMaorKaltura with Copilot wants to merge 5 commits into
Conversation
…nd their relations Agent-Logs-Url: https://github.com/kaltura/server/sessions/07c7b26d-48dc-494f-b8d7-7c07b76b860c Co-authored-by: MosheMaorKaltura <10695851+MosheMaorKaltura@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kaltura/server/sessions/07c7b26d-48dc-494f-b8d7-7c07b76b860c Co-authored-by: MosheMaorKaltura <10695851+MosheMaorKaltura@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kaltura/server/sessions/07c7b26d-48dc-494f-b8d7-7c07b76b860c Co-authored-by: MosheMaorKaltura <10695851+MosheMaorKaltura@users.noreply.github.com>
- Restore child categories recursively (ordered by depth) - Restore categoryKuser only for MANUAL inheritance categories - Rebuild hierarchy fields (reSetFullIds, reSetDepth, reSetFullName) - Recalculate all counts (entries, directEntries, members, subCategories) - Update parent category's sub-categories count - Trigger re-indexing for search Agent-Logs-Url: https://github.com/kaltura/server/sessions/65e08e9e-09d8-48f6-8b43-4cda3ceae986 Co-authored-by: MosheMaorKaltura <10695851+MosheMaorKaltura@users.noreply.github.com>
…imize batch queries Agent-Logs-Url: https://github.com/kaltura/server/sessions/65e08e9e-09d8-48f6-8b43-4cda3ceae986 Co-authored-by: MosheMaorKaltura <10695851+MosheMaorKaltura@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
MosheMaorKaltura
April 20, 2026 06:28
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
Please complete the following before submitting:
General notes -
New Kaltura Types
New Kaltura Services / Actions
Questions
What is the purpose of this PR?
Does this change affect production code or infrastructure?
If yes, what is the rollback plan?
alpha/scripts/utils/restoreDeletedCategory.phpto rollback. If executed withrealrun, restored records would need manual re-deletion.Summary
New script
restoreDeletedCategory.phpperforms full category restoration based ongetDeletedAt()timestamp matching.What it restores
categoryEntryrecords deleted within time deltacategoryKuserrecords forInheritanceType::MANUALcategories onlyreSetFullIds(),reSetDepth(),reSetFullName()indexToSearchIndex()for all restored categoriesdirectSubCategoriesCountUsage
Key implementation details
deleted_at/updated_atwithin configurable delta (default 60s)FULL_IDSprefix matching