Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2227276 - [RFE] Add a new section called "12.3 Recovering pulp data after a successful restoration" within the "Administering Red Hat Satellite" guide of Satellite 6.14
Summary: [RFE] Add a new section called "12.3 Recovering pulp data after a successful ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.14.0
Hardware: All
OS: All
medium
high
Target Milestone: 6.14.0
Assignee: Akshay Gadhave
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-28 15:24 UTC by Sayan Das
Modified: 2024-09-27 04:25 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-05-29 17:05:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SAT-19241 0 None None None 2023-07-28 15:26:07 UTC

Description Sayan Das 2023-07-28 15:24:32 UTC
Document URL: 

https://dxp-docp-prod.apps.ext-waf.spoke.prod.us-west-2.aws.paas.redhat.com/documentation/en-us/red_hat_satellite/6.14/html-single/administering_red_hat_satellite/index?lb_target=preview#restoring-satellite-server-or-capsule-from-a-backup_admin

Section Number and Name: 

Chapter 12. Restoring Satellite Server or Capsule Server from a Backup

Describe the issue: 

We support restoring a backup that was taken without pulp content but we don't explain how to recover the pulp content afterwards. 

Sat 6.14 has improved quite a bit now ( the pulp Repair API functionality improvements ) and we can actually get back the Pulp data after such a restoration has been done.



Suggestions for improvement: 

Add a new section called "12.3 Recovering pulp data after a successful restoration" 

This section should be dedicated to the scenario where a backup was taken without pulp data and was restored for a satellite or capsule 6.14 server and user now wants to recover that Pulp data.


## In case of Satellite ##


* For all yum type repos that has an Upstream URL specified:

--> Perform "Complete Sync" 
--> Perform "Validate Content Checksum" action\sync

URL: https://dxp-docp-prod.apps.ext-waf.spoke.prod.us-west-2.aws.paas.redhat.com/documentation/en-us/red_hat_satellite/6.14/html-single/managing_content/index?lb_target=preview#Recovering_a_Corrupted_Repository_content-management

-> To identify such repos:

# hammer --csv --no-headers repository list --search "content_type = yum" --fields Id,Name,Url,Product | awk -F, '{ if ($4) print $1","$2","$3 ;}'


-> To run the expected action on them via hammer_cli :

IFS=$'\n'; for i in $(hammer --csv --no-headers repository list --search "content_type = yum" --fields Id,Name,Url | awk -F, '{ if ($3) print $1","$2 ;}'); do ID=$(echo $i | cut -d, -f1); REPO=$(echo $i | cut -d, -f2); echo "Working on $REPO"; hammer repository synchronize --id $ID --organization RedHat --skip-metadata-check true; sleep 2; hammer repository synchronize --id $ID --organization RedHat --validate-contents true;echo -e "\n\n";done


------


* For all docker type repos that has an Upstream URL specified:

--> Perform "Validate Content Checksum" action\sync
--> And then simply re-sync the repository.

URL: https://dxp-docp-prod.apps.ext-waf.spoke.prod.us-west-2.aws.paas.redhat.com/documentation/en-us/red_hat_satellite/6.14/html-single/managing_content/index?lb_target=preview#Recovering_a_Corrupted_Repository_content-management


-> To identify such repos:

# hammer --csv --no-headers repository list --search "content_type = docker" --fields Id,Name,Url,Product | awk -F, '{ if ($4) print $1","$2","$3 ;}'


------


* For all File type repos that has an Upstream URL specified:

--> Perform "Validate Content Checksum" action\sync
--> Perform "Republish Repository Metadata" action ( to regenerate the PULP_MANIFEST ) by following "5.16. Republishing Repository Metadata"
--> And then simply re-sync the repository to confirm nothing is missing.

URL: 
  https://dxp-docp-prod.apps.ext-waf.spoke.prod.us-west-2.aws.paas.redhat.com/documentation/en-us/red_hat_satellite/6.14/html-single/managing_content/index?lb_target=preview#Recovering_a_Corrupted_Repository_content-management
  https://dxp-docp-prod.apps.ext-waf.spoke.prod.us-west-2.aws.paas.redhat.com/documentation/en-us/red_hat_satellite/6.14/html-single/managing_content/index?lb_target=preview#Republishing_Repository_Metadata_content-management

-> To identify such repos:

# hammer --csv --no-headers repository list --search "content_type = file" --fields Id,Name,Url,Product | awk -F, '{ if ($4) print $1","$2","$3 ;}'



* For any yum type repos, having no upstream URL specified and the contents were manually managed\uploaded, Re-upload the expected contents in the same way. 

-> To identify such repos:

# hammer --csv --no-headers repository list --search "content_type = yum" --fields Id,Name,Url,Product | awk -F, '{ if (! $4) print $1","$2","$3 ;}'


* For any file type repos, having no upstream URL specified and the contents were manually managed\uploaded, completely delete the repo and recreate it. Once done, reupload the files.

( We perhaps could have fixed it by simply reuploading the file and republishing the CV metadata as well but https://bugzilla.redhat.com/show_bug.cgi?id=2227289 blocks it )

-> To identify such repos:

# hammer --csv --no-headers repository list --search "content_type = file" --fields Id,Name,Url,Product | awk -F, '{ if (! $4) print $1","$2","$3 ;}'



* For the component and composite content-view versions promoted to lifecycle environments, Republish their repository metadata by following "5.17. Republishing Content View Metadata"

https://dxp-docp-prod.apps.ext-waf.spoke.prod.us-west-2.aws.paas.redhat.com/documentation/en-us/red_hat_satellite/6.14/html-single/managing_content/index?lb_target=preview#Republishing_Content_View_Metadata_content-management

(Until https://bugzilla.redhat.com/show_bug.cgi?id=2227271 is fixed, "Republishing Content View Metadata" would not work. So users have to perform a new CV version publish and promote )


## In case of capsules ##

* If any external capsules were restored in a similar manner i.e. without the pulp data then:

  --> Execute the "Pulp Repair" action on the capsule server as explained in the article https://access.redhat.com/solutions/6961905 , under the segment "Can the same repair action be performed in a Red Hat Satellite Capsule 6.10 and above?" and wait for it to complete.
  --> Execute a "Complete Sync" for the same capsule to ensure all repository metadata has been properly republished.


Additional information: 


Please discuss this with Katello and Pulp SMEs and feel free to let me know if any further information is needed from my end.

Comment 1 Evgeni Golov 2023-08-09 08:40:18 UTC
> We support restoring a backup that was taken without pulp content but we don't explain how to recover the pulp content afterwards. 

Is that really true?

https://access.redhat.com/documentation/en-us/red_hat_satellite/6.13/html/administering_red_hat_satellite/backing-up-satellite-server-and-capsule_admin#Performing_a_Backup_Without_Pulp_Content_admin says:

You can perform an offline backup that excludes the contents of the Pulp directory. The backup without Pulp content is useful for debugging purposes and is only intended to provide access to configuration files without backing up the Pulp database. You cannot restore from a directory that does not contain Pulp content.

Comment 2 Sayan Das 2023-08-09 09:13:15 UTC
Thanks for pointing out that doc section. I somehow missed it for sure. 

I had asked about the same stuff to support\PLM and I was told that There is no reason to NOT support this if it can be technically achieved. And hence the BZ ( and it's only possible in 6.14 due to various fixes included for repair API ).

We do have some customers requesting this in the not-too-distant past as well ( Hilti was one of them ) and I will try to attach those cases here if I can find them today. 


Being that said, I am fine with closing this bug as long as we stand by our statement from the section "Performing a Backup without Pulp Content".

Comment 13 Red Hat Bugzilla 2024-09-27 04:25:05 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


Note You need to log in before you can comment on or make changes to this bug.