1

So here's where I'm at:

I've had Ubuntu Server 12.04 install on a 250GB drive for a while, and I've spent some time getting it configured properly with a number of programs. I want to migrate the data/config to a bigger drive, but instead of using dd or Clonezilla (like a normal person), I started with a clean install on the new drive - I wanted to change the main admin username, install without home folder encryption (which I removed by hand from the old drive), and stop using LVM for a single-drive machine.

So here's where I'm at: I have Ubuntu Server installed on the new disk, and the main partition from the old disk is currently mounted at /mnt/old_drive, so I have access to all the files and things. I also have a dump list of all the packages I installed on the old machine.

So here's my question: how much of this stuff can I just copy over directly, reboot and have it work? Just /etc? I've got a couple things, like MySQL and PostgreSQL DBs, that I'm not sure if I can just copy over with cp.

Or would I be better off installing each package and configuring/migrating them individually? I think the fact that I change the admin username on the new install may add a wrinkle (or not).

Edit: I also do know I need to edit fstab rather than copying it over.

1 Answer 1

0

If you are up for the learning experience, try backing up your current new /etc and then copying the files from /etc incrementally from the old drive to the new drive. As long as you arent changing versions of packages most software will gracefully handle that. There are however a few files that wont work, /etc/fstab being one prominent example. Also be careful with files in /etc/udev (as this will most likely contain hardware specifics, like MAC addresses of your networking hardware, etc)

If however you want to be on the safe side, just don't copy the files and manualy redo the changes.

Of course you could also use a tool like kdiff3 or similar to compare the differences and visually migrate the settings.

I personally would assume that the fact that you changed the admin username (I presume you mean user which you will be mainly using the computer with) might indeed cause some trouble, specifically with the SQL DBs as they tend to have the access rights stored somewhere within the DBs, however this could possibly be solved with an automated search and replace SQL statement. Additionally run grep -R with your old username over your old /etc directory and see if you get any hits other than the usual (passwd, shadow, groups) and improvise ;-)

2
  • Thanks for the /etc/udev warning, though I will mention this is the same machine, just not the same hard drive. I'm down for a learning experience :). One question: would you mind elaborating a bit on the other folders in root, i.e. bin lib usr and var? Are any of these necessary to copy over?
    – mAAdhaTTah
    Commented Nov 15, 2013 at 16:36
  • It would probably be better to not copy files from any directories other than /etc /home/* and some select folders from /var which pertain to your SQL DBs and/or other servers. Oh, the usual /local /usr/local and such directories are fine of course. If you had /opt I think it should be ok too, but I'm not entirely sure there. For details on which files to copy for a DB migration either check the docs search Stackoverflow or make a new question for those servers with apropriate tags. Commented Nov 15, 2013 at 17:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .