ConfigSave-ConfigLoad

  • Launchpad Entry: configsave-configload

  • Created: March 27, 2008

  • Contributors: Mark Kasson (aka sigger)

  • Packages Affected: None

  • See Also:

Summary

This specification describes a script for moving organization/installation specific information from one computer to another or to a reinstallation.

Rationale

There are a number of times when one brings up a server and wishes to replicate the server level data either from its previous Ubuntu install or from another Ubuntu install. It is time consuming to fetch and reenter (1) various /etc items such as users, groups, passwords, smbpasswd entries, hosts, etc (2) various config files and (3) the misc scripts placed here and there. Similarly desired apt-gets could be done as well. Automation of the saving of these items and automation of the loading of these items would save significant time. Conceivably this could also be a useful backup mechanism as well.

Use Cases

  • Anton has one Ubuntu 6.06 server and is bringing up another 6.06 server. He wishes to have the same users, pws, misc scripts, etc on this server as he already does on the other. He exectues ConfigSave on the existing server to the save the various config items to a thumbdrive. As he installs on the new server, the installation process allows him to run ConfigLoad which installs the settings onto the new server. Upon installation the new server knows about his 14 users, their passwds, the names of other computers, etc.

  • Llewelyn has broken his 6.06 server. He wishes to reinstall 6.06 (or perhaps some later release) over top of this broken installation. Prior to reinstalling he runs ConfigSave to store the info to a mount on the LAN. As part of his installation, he points ConfigLoad to the location of the data file with his settings, which are then reestablished.

  • Tommy Lee wishes to bring up a server on a temporary basis. He runs ConfigSave on his existing server to save info on users, hosts, mounts, etc. On the temporary server he runs the LiveCD, then runs ConfigLoad. His temporary server now has knowledge of users, hosts, mounts, etc.

  • Carson is replacing the hard drive which contains his boot partition, etc in his server with a larger drive. ConfigSave saves the data for him and Ubuntu installs on his new hard drive with user, etc information

Scope

This is intended to discuss a script to save various information items, not to change the content or location of any of those items. It is not intended to change the Installation process (other than the possibility of adding this as an installation option).

Design

A specification needs to be written that will:

  • specify which files need to information culled from (e.g. passwd, groups, hosts, smbpasswd - if it exists)
  • determine which information is server specific versus standard info (e.g. user nobody with the normal user number is not server specific and should not be saved)
  • determine where other information on what should be saved should be kept
  • determine what, if any, level of user interaction there ought to be to determine if data is imported or not.

Implementation

A bash script needs to be written that will

  1. cull the non-standard users and their passwords, groups (including shadows), smbpasswds; hosts; and other items
  2. read a specific cleartext file (e.g. /etc/ConfigSave) for the section which contains a list of other files to be saved (e.g. [saves] /etc/samba/* /etc/mysql/my.conf)
  3. read that same file for the section with the list of apt-get install's to be done e.g. [apt-get] samba openssh-server

Damn Small Linux has/had something like this and could certainly be used for inspiration.

ConfigSave-ConfigLoad (last edited 2008-08-06 16:19:25 by localhost)