2 Methods to backup/restore configuration channels on a satellite 5.x server using rhncfg-manager or spacecmd

Latest response

ALTERNATE METHOD (scroll down) using spacecmd is mentioned by Red Hatter Rich Jerrido (thanks Rich) at this discussion.

Method One

I don't always move my configuration channels from one satellite server to another, but when I do, I use one of these methods (scroll down for the second method, which may be even easier).

This script requires the rpm package rhncfg-manager to be installed first, and before using this, the person must have an account on their satellite server with proper permissions to do this...

yum -y install rhn-management
---output truncated---
rhncfg-manager list-channels | egrep -v Available | perl -ne 'print "\tDownloading config channel $_\n";chomp;system("/bin/mkdir $_;rhncfg-manager download-channel -t $_/ $_ ")'
Red Hat Network username: 
Password:
echo "see image for sample output"

See attached image for output, ran from our new satellite 5.7 development satellite server with a few very minor sample configurations.

I am confident there's probably a more elegant way to do this... but this does work.

To import...

cd /to/the/path/where/you/saved/your/config/channels/
ls | perl -ne 'print;chomp;system("rhncfg-manager upload-channel --channel=$_ -t $_/")'

Method Two using "spacecmd"

There is a CLI (command line interface) called 'spacecmd' which comes with Satellite 5.7, you have to install it on satellite 5.6.

Once you enter spacecmd command line interface, then use the spacecmd CLI configchannel_export which creates a file named "cc_all.json" file

Then on the server you wish to import the channels on - use configchannel_import /my/path/to/my/json/cc_all.json

Responses