I'm new to Ubuntu and recently started using it on my PC. I'm going to replace that PC with a new machine. I want to transfer my data and settings to the nettop. What aspects should I consider?
Obviously I want to move my data over. What things am I missing if I only copy the entire home folder?
This is a home pc (not corporate) so user rights and other security issues are not a concern, except that the files should be accessible on the new machine!
Please take into account that the new machine is a nettop that doesn't have an optical drive and doesn't allow me to hook the old SATA disk into it, so any data transfer must be handled via home network (I can have both the old and the new machine turned on and connected to the home LAN) and I have an USB thumbdrive with limited capacity (2GB).
This sounds like it might limit the general applicability, but it would in fact make it more general.
User settings are stored in the Home folder by design. So, if you copy your
/home/your-username
to your new computer, you should be fine......but there are caveats:
--preserve=mode
switch (usingcp
) or-p
(usingtar
)You can find the current userID and groupID by executing
id
. For example, to change the userID of user "your-username", runsudo usermod --uid 1234 your-username
. To change the groupID, you have to runsudo groupmod --gid 1234 your-username
.Settings (Firefox profile, appearance, ...) are often stored in hidden folders (or files). Hidden folders/files are prefixed with a dot, like
.mozilla
for Firefox (and other Mozilla applications).As security is not an issue, and you want to have the copying job done as fast as possible, I suggest a combination of the netcat and tar programs. Both applications are installed by default. Make sure that the firewalls on both computers allows ingoing access to destination port 8888 (source computer) and outgoing to destination port 8888 (target computer). Put the nettop next to the computer so you can run the commands quickly.
On the source computer, you need to have the traditional netcat program installed (a.k.a. Swiss Army Knife, not the BSD one). To do so, install the
netcat-traditional
package. You may also want to configure the traditional netcat program as default. Commands to install netcat-traditional and use it as default:On the source computer, type the next command in a terminal (do not press Enter yet):
Explanation:
cz
creates such a packed file ("tarball")-C/home $(whoami)
changes the working directory to/home
and puts your username folder. Alternative, you can type youryour-username
folder in the tarballnc
(netcat) is used for setting up connections between machines easily-l
: Listening mode, allows other machines to connect to the current machine-p 8888
: Listens on port 8888 (randomly chosen number, it could be any other number higher than 1024 as well)-w 10
: quit netcat after 10 seconds silence. You must connect to this source computer within this time.Now go to the target computer (nettop). To add the files to the target machine, type (do not run it yet):
192.168.1.2
is the IP address of the source computer. To get its IP address, run:ifconfig
on the source machine8888
is the port number as entered on the source machinexzp
: extracts the GZip-compressed tarball while preserving permissions.-C/home
: extracts theyour-username
folder to/home/your-username
-v
switch to the tar command for verbose extraction, so you can get an idea of the progress. This could slow down the copy process because every file has to be printed.Now go to the source computer, press Enter to run the server command. Quickly switch to your nettop and press Enter to run the client command.
If you have any questions, just use the comment field below.
For the software packages, you should read the following : http://www.omgubuntu.co.uk/2010/05/transfer-your-packages-to-a-clean-install/
For the settings and data, it's a little more complicated :-( Most of the settings are stored in your home folder, so making a backup of your HOME may do the trick... But then of course this doesn't cover the system apps, that have their config stored in /etc...
The majority of all settings for applications are in your home folder hidden by default. If you press
Ctrl+h
in Nautilus you'll see these folders. I've found the easiest way is to simply rsync the folders you need over for the configurations. Something like this:rsync -avz me@remote:/home/me/.foo me@remote:/home/me/.var me@remote:/home/me/.ack me@remote:/home/me/.bar /home/me/
You could also - just rsync your entire home folder to the new machine - but that may cause problems depending on your setups.
Ubuntu devs are working on it, it is called OneConf.
If you have an installation you like on one machine, you can simply clone it. It doesn't matter if the machines have different hardware as long as they run the same architecture (32-bit or 64-bit, i.e., i386 or amd64 or ...).
Here's a way to do it. It's a bit long, but fairly low-tech. Many variations are possible.
gparted
) and copy the whole old disk to the new disk.sudo tune2fs -U $(uuidgen) /dev/sdz1
wheresdz
is the new disk and1
is the partition number.sudo cp -ax / /media/disk9
(replace/media/disk9
by the location where the new root partition is mounted)./media/disk9; adjust as needed
):/media/disk9/etc/hostname
to set the new machine's name. Check files under/media/disk9/etc/
for other occurrences of the host name — it might appear in/media/disk9/etc/hosts
,/media/disk9/etc/mailname
, etc./media/disk9/etc/ssh/ssh_host_*_key*
. The server will generate new keys when you boot the new installation./etc/network/interfaces
, edit/media/disk9/etc/network/interfaces
for the new installation./etc/udev/rules.d/70-persistent-*.rules
if present, so that your disks and network interfaces reuse the same names (sda
,eth0
, …) on the new machine./media/disk9/etc/X11/xorg.conf
to/media/disk9/etc/X11/xorg.conf.old-machine
, otherwise you may not be able to boot to a GUI in the new machine.dpkg-reconfigure openssh-server
to generate a new host key.All your data and setting live on your home.
If you only copy it, you will lose:
I feel that the easiest way to make a network copy is this:
ssh://ip-of-old-computer/home/
Dropbox.
This is how I back up my settings from one machine to another, and if I completely lose my hard disk it doesn't matter.
Dropbox is an online backup/synchronization service, and it kicks major booty, and you can get it for free. It's available under ubuntu Karmic and up under the Partner repositories. You're looking for a package called nautilus-dropbox. Or, you can just download it from the site: https://www.dropbox.com/downloading?os=lnx
As above people mentioned, most of your relevant settings are saved under
/home/yourname/.whatever
For example gnome configuration settings are saved under
So, to do the synchronization:
Part one: Back up config settings to Dropbox. (This is all on the "old" machine, where you have your settings/configuration how you want them.)
Part two: (On new machine.) Create links from Dropbox-synchronized config settings.
Voila. You now have internet-based settings backup and migration.
Take a look at Stipple, looks interesting to me:
"Save a list of installed applications, .config files, and other settings to a couchDB. Sync this DB to other computers with Ubuntu One. This application also helps you install those packages and .config files on your other computers."
https://launchpad.net/stipple
Mackup can backup many apps to the cloud or version control. It's easy to extend, for example, this is how the ssh plugin looks like
This restores all your personalized settings.
To Export
Open a terminal and type this
This will copy the user settings in your home directory in a file named
settings-backup
.To Restore
Move the
settings-backup
to your new machine and open a terminal and type thisThis will restore the theme settings and the window manager settings.
(Note that, If you delete a theme, it can't restore that theme)
Logout and Login again, to see all your copied settings.