Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I use ubuntu to deal with daily job. Now I buy a new laptop, and I want to migrate my whole system(programs, packages, data, settings, etc) to the new machine.

I know I can copy my home folder to new machine and I will get (almost) all data and settings. But is there a safe way to copy the whole system? Or it's a bad idea?

share|improve this question
    
Is anything stopping you from swapping the old drive to the new system, or the image of it to a new drive? I got a new laptop and just put the drive from the old one in the new one and that was it. –  Bert Mar 27 '13 at 1:24

3 Answers 3

First off, How to list all installed packages? this question covers exporting (then installing) your exact set of packages.

As you noted, most of your configuration will be in /home.

That being said, each time I do this, I start from scratch so to speak. I'll install ubuntu and manually add packages that I know I use, configuring them one at a time. The list of packages installed on your old computer is a good starting place to find different pieces. Once stuff is more or less set up, I'll then copy over just the data files (but not the config files) from my old computer. This does take more time to do, but it's worth it to switch to the newest version. (My old desktop runs 10.04, my new on currently runs 11.10, although I plan on updating that to 12.04 when it has been around for a month to work off any remaining rough edges) But this plan is for if you're ok with a few things working slightly differently than before. If you need things to be exactly the same, go ahead and do the above.

share|improve this answer
    
+1 This is pretty much how I do it, too. –  BryceAtNetwork23 Mar 8 '12 at 19:40

Prerequisites:

The same version of Ubuntu is installed on both machines. The architecture (32/64 bit) can be different.

Step 1: Store the list of installed packages

Run the following command on the source machine to store the installed packages names in ~/pkglist:

sudo dpkg --get-selections | sed "s/.*deinstall//" | sed "s/install$//g" > ~/pkglist

Step 2: Transfer your config

Use scp or rsync or even a flash drive to transfer your home directory (~/, ~/.), the source list (/etc/apt/sources.list) and any other files you customized or installed (like apache config under /etc or softwares on /opt) from the source machine to the target one.

Step 3: Install packages

On the target machine run the following command in a failsafe terminal session to install your packages:

sudo aptitude update && cat pkglist | xargs sudo aptitude install -y

Extract from:

http://eggsonbread.com/2010/01/28/move-ubuntu-to-another-computer-in-3-simple-steps/

share|improve this answer
1  
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  Seth Mar 27 '13 at 1:13
    
Changes done :) –  Ricardo Bou Mar 27 '13 at 13:16
2  
Step 2 is still rather vague –  Adonis K. Oct 26 '13 at 12:28

There are several utilities that can make direct copies of your file system and some (Norton Ghost for example) can adjust your partitions to adapt to the new disk. Software like this allows you to not only copy from disk to disk but also keep a separate, compressed backup for yourself in the future.

There's also the tool dd to do this, however it takes a bit more knowledge and research to produce the results that you would like.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.