[rancid] Renaming devices? (svn backend)

Per-Olof Olsson peo at chalmers.se
Wed Apr 17 14:45:40 UTC 2013


Howard Jones skrev 2013-04-17 15:41:
> Hi Folks,
>
> I'm just about to implement a new naming scheme for all our network gear, and I'd like to rename it in such a way that I don't
> lose the history in RANCID. I found a couple of messages in the list archive for the way to do this with a CVS backend, but I have
> Subversion. Does anyone know the svn-fu necessary to do this cleanly?
>
> Thanks,
>
> Howard
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss


 From rancid FAQ:

...
Q. I am renaming a device but would like to retain the history in CVS.  How
    is this done?
A. CVS does not provide a way (AFAIK) to rename files or to rename or delete
    directories.  The best way is to copy the CVS repository file manually
    like this (disclaimer: BE VERY CAREFUL mucking around with the repository):
         % su - rancid_user
         % cd <LOCALSTATEDIR>
         % echo "new_device_name:device_type:up" >> <GROUP>/router.db
         % cp -p CVS/<GROUP>/configs/old_device_name,v \
                 CVS/<GROUP>/configs/new_device_name,v
         % cd <GROUP>/configs
         % cvs update

    where GROUP is the name of the rancid group that the device is a member of.
    Once the renaming is complete, remove the old name from the router.db file
    and leave the CVS clean-up of the old filename to rancid.

    If one wanted to move a device to a different group and maintain the
    history, the same procedure would work, substituting the new group name
    appropriately and editing the router.db of both old and new groups, of
    course.

    SVN provides a rename function; but we suggest that you use it's
    copy function instead, and leave the clean-up of the old name
    to rancid.  So, you would use the copy function (proper
    substitutions, of course) in place of the cp in the CVS example,
    then commit the new file.
...

Done this for some switches. Have worked nicely (I using CVS)

/Peo
----------------------------------------------------------
Per-Olof Olsson               Email: peo at chalmers.se
Chalmers tekniska högskola    IT-service
Hörsalsvägen 5                412 96 Göteborg
Tel: 031/772 6738  Fax: 031/772 8680
----------------------------------------------------------


More information about the Rancid-discuss mailing list