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 1389814 - katello-restore refuses to restore a backup created with katello-backup --skip-pulp-content
Summary: katello-restore refuses to restore a backup created with katello-backup --ski...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Backup & Restore
Version: 6.2.3
Hardware: x86_64
OS: Linux
high
high
Target Milestone: Unspecified
Assignee: Christine Fouant
QA Contact: jcallaha
URL: http://projects.theforeman.org/issues...
Whiteboard:
: 1387785 1434812 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-28 18:19 UTC by Patrick C. F. Ernzer
Modified: 2021-12-10 14:47 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:54:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 17174 0 High Closed katello-restore refuses to restore a backup created with katello-backup --skip-pulp-content 2020-12-30 15:07:02 UTC

Description Patrick C. F. Ernzer 2016-10-28 18:19:10 UTC
Description of problem:
katello-restore refuses to restore a backup created with katello-backup --skip-pulp-content

Version-Release number of selected component (if applicable):
Satellite 6.2.3
katello-common-3.0.0-14.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
1. katello-backup --skip-pulp-content /var/satbackup/2016-10-28
2. satellite-installer --reset
3. katello-restore /var/satbackup/2016-10-28/

Actual results:
20:03:34 [root@satellite ~]# katello-restore /var/satbackup/2016-10-28/
**** Given directory does not include pulp content ****
**** Please choose a backup that contains pulp content ****
Usage: katello-restore /path/to/dir [options]
 eg: $ katello-restore /tmp/katello-backup
    -y, --assumeyes                  Answer yes for all questions
20:03:54 [root@satellite ~]# 

Expected results:
ability to restore a backup created as per https://access.redhat.com/documentation/en/red-hat-satellite/6.2/paged/server-administration-guide/chapter-6-backup-and-disaster-recovery
either via a --no-pulp-present or similar flag to katello-restore
or "katello-backup --skip-pulp-content" creating an empty pulp data file

Additional info:

Comment 3 Patrick C. F. Ernzer 2016-10-28 19:01:10 UTC
workaround;
touch pulp_data.tar in the backup directory, prior to running katello-restore

Comment 4 Brad Buckingham 2016-10-31 19:10:12 UTC
*** Bug 1387785 has been marked as a duplicate of this bug. ***

Comment 5 Christine Fouant 2016-11-01 19:45:20 UTC
Created redmine issue http://projects.theforeman.org/issues/17174 from this bug

Comment 6 Kev 2016-11-01 19:58:29 UTC
workaround that doesn't cause errors on restore is to make an empty tarball, rather than touch.

tar -vcf pulp_data.tar /dev/null

Comment 7 Bryan Kearney 2016-11-01 20:03:34 UTC
Upstream bug component is Packaging

Comment 8 Bryan Kearney 2016-11-14 19:03:21 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17174 has been resolved.

Comment 9 Christine Fouant 2017-03-22 13:16:44 UTC
*** Bug 1434812 has been marked as a duplicate of this bug. ***

Comment 18 jcallaha 2018-01-31 19:00:43 UTC
Verified in Satellite 6.3 Snap 33. Check attached output.txt file for full restore output.


-bash-4.2# satellite-backup --skip-pulp-content /tmp
Starting backup: 2018-01-31 19:24:27 +0100
Creating backup folder /tmp/satellite-backup-20180131192427
Generating metadata ... 
Done.
Backing up config files... 
Done.
WARNING: This script will stop your services. Do you want to proceed(y/n)? y
Stopping services...
Redirecting to /bin/systemctl stop foreman-tasks.service
Redirecting to /bin/systemctl stop httpd.service
Redirecting to /bin/systemctl stop pulp_celerybeat.service
Redirecting to /bin/systemctl stop pulp_streamer.service
Redirecting to /bin/systemctl stop pulp_resource_manager.service
Redirecting to /bin/systemctl stop pulp_workers.service
Redirecting to /bin/systemctl stop tomcat.service
Redirecting to /bin/systemctl stop postgresql.service
Redirecting to /bin/systemctl stop mongod.service
Backing up postgres db...
Done.
Backing up mongo db... 
Done.
Starting services...
Redirecting to /bin/systemctl start mongod.service
Redirecting to /bin/systemctl start postgresql.service
Redirecting to /bin/systemctl start tomcat.service
Redirecting to /bin/systemctl start pulp_workers.service
Redirecting to /bin/systemctl start pulp_resource_manager.service
Redirecting to /bin/systemctl start pulp_streamer.service
Redirecting to /bin/systemctl start pulp_celerybeat.service
Redirecting to /bin/systemctl start httpd.service
Redirecting to /bin/systemctl start foreman-tasks.service
Done with backup: 2018-01-31 19:27:49 +0100
**** BACKUP Complete, contents can be found in: /tmp/satellite-backup-20180131192427 ****


Performed some changes (including removing hosts)

-bash-4.2# satellite-restore /tmp/satellite-backup-20180131192427
WARNING: This script will drop and restore your database.
Your existing installation will be replaced with the backup database.
Once this operation is complete there is no going back.
Are you sure(Y/N)? y
Starting restore from /tmp/satellite-backup-20180131192427: 2018-01-31 19:42:01 +0100
Setting file security
Done.
Resetting Katello
yes | foreman-installer -v --reset --scenario satellite --disable-system-checks
[ INFO 2018-01-31 19:44:00 verbose] Executing hooks in group pre_migrations
...
[ INFO 2018-01-31 19:53:40 verbose] Installer finished in 583.163295715 seconds
Done.
Stopping Katello services
...
Done.
Migrating pulp databases
...
Attempting to connect to localhost:27017
Attempting to connect to localhost:27017
Write concern for Mongo connection: {}
Loading content types.
Loading type descriptors []
Parsing type descriptors
Validating type descriptor syntactic integrity
Validating type descriptor semantic integrity
...
Updating the database with types []
Found the following type definitions that were not present in the update collection [puppet_module, docker_tag, ostree, package_langpacks, erratum, docker_blob, docker_manifest, yum_repo_metadata_file, package_group, package_category, iso, package_environment, drpm, srpm, rpm, distribution, docker_image]
Updating the database with types [puppet_module, docker_tag, ostree, package_langpacks, erratum, docker_blob, docker_manifest, yum_repo_metadata_file, package_group, package_category, iso, package_environment, drpm, distribution, rpm, srpm, docker_image]
Content types loaded.
Ensuring the admin role and user are in place.
Admin role and user are in place.
Beginning database migrations.
...
Database migrations complete.
Done.
Done.
Ensuring all Katello processes are started
...
Done.
Done with restore: 2018-01-31 19:55:43 +0100

Comment 20 Satellite Program 2018-02-21 16:54:17 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> 
> For information on the advisory, and where to find the updated files, follow the link below.
> 
> If the solution does not work for you, open a new bug report.
> 
> https://access.redhat.com/errata/RHSA-2018:0336


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