e-mail   
 Menu
  Home
  Download
  Top 10 Downloads
  Last 15 New Files
  Web Links
  Tips
  Last 15 New Tips
  NLM Programming
  Admins Club





Installation and Administration






Polish Forum SUSE




Novell Connection Magazine


 
Who's Online

 There are currently,
5 guest(s)
that is (are) online.
 


Technical Information

Back to List of Categories

Technical Information about
  A Little YaST Magic
  A Slideshow for Your KDE Wallpaper
  Add Novell Support to Your Firefox Search Engine
  Adding To The Panels In Gnome.
  Akregator - RSS News Reader
  An Introduction to WBEM and OpenWBEM in SUSE LINUX
  Authenticating SUSE LINUX to eDirectory via LDAP
  Basic Mounting Differences between Windows and Linux
  Beginner's Guide to Using Novell SUSE LINUX's Build Utility
  Browsing Files
  Card Readers on SUSE LINUX 9.2 Professional?
  Changing the Default Browser in Gnome
  Developing Perl CGI scripts on SUSE LINUX
  Do I Have Permission?
  Double SYNC -- Using RSYNC Simultaneously With and Without Branch Office for Data Backup
  Dumb Question: Mounting Linux CDs
  Easy Command-Line Introduction
  Easy Way to Debug SSL Connections
  Enabling an Interactive Startup in Novell/SUSE LINUX
  Exploring MySQL 4.1 and PHP 5 on SUSE LINUX
  Extend Your Panels Using Gnome Drawers.
  Firefox Speed Tip
  Fix Java Errors With ConsoleOne On Linux
  Fix Your Mouse Wheel...
  Gimp -- Closing In on Photoshop...
  Gimp Tips Part 1: Resizing Images
  Gimp Tips Part 2: Rounding Corners
  Gimp Tips Part 3: Fading Photography Edges
  Gimp Tips Part 4: Selective Colorization
  Gimp Tips Part 5: Plugins a Plenty - Adding Light
  Gimp Tips Part 6: Using The Clone Tool
  Google Auto-fill Replica for Linux
  How a Corrupted USB Drive Was Saved by GNU/Linux
  How to Implement Login Scripts into a Pure Linux Environment
  How to install and connect an External Modem on a Linux PC
  How to Install the Novell Client for Linux on SUSE Linux 10.0
  How to launch applications at login in Gnome
  How to Remote Control Linux
  How to setup a Linux application to automatically startup when you login.
  How to share Files and Printers Between Linux and MS Windows with Samba
  How to uninstall the Novell Client for Linux
  How to upgrade the Novell Client for Linux
  How to use SMB without turning off the firewall
  How's the Weather?
  HTML Development Tools in Linux
  Informative Bash Prompt
  Install and Use QEMU on SUSE 9.2
  Install Linux Frequently, Without the Hassle
  Installing Apache, PHP, and MySQL on SUSE LINUX Professional
  Installing RPM Files
  Integrating Novell Linux Desktop into a Novell NetWare network
  Introduction to Oracle 10g R1 (10.1.0.3) on SUSE LINUX Professional 9.3
  iPrint Printers on Novell Linux Desktop
  Linux Scheduling Priorities Explained
  Make a Misbehaving Program Quit
  Manually Mounting a USB Flash Drive in Linux
  Migrating To Linux, Advantages Over Windows 9.x And XP
  Minimize Your Maximizing with Multiple Desktops
  Mounting NetWare Volumes On NLD Illustrated
  Move Your /home to Another Computer
  Mozilla Mail Review
  Need a Backup?
  Novell Client Settings with Windows Terminal Server
  Novell Linux Desktop Equivalents of Windows Software - New and Improved
  Novell Linux Desktop System Upgrade How-To
  Partitioning Hard Drive for Linux Install
  Perform Remote SuSE Installations With Virtual Network Computing
  Quick Intro to Klipper
  Quick Shortcuts in The Gimp
  Reset Your Lost Root Password
  Resizing Your Gnome / KDE Panels
  Runlevels in SUSE LINUX
  Running Existing Win32 Applications on SUSE LINUX
  Service Command in /etc/init.d/
  Setting Shortcut Keys
  Setting up a Linux NFS Install Source for Your LAN
  Should I choose Novell Linux Desktop or SUSE LINUX Professional as my desktop?
  Starting Services From the Command Line On SuSE LINUX
  Sticky Notes for Gnome
  SUSE LINUX 9.3 Professional Review
  Sync Up The Taskbar and the Desktop in Gnome
  System Upgrade How-To
  Taking Screenshots in Linux
  The Basics of Messaging in the Cross-Platform GroupWise Client
  The Novell Client for Linux (beta).
  Transparent Panels in Gnome
  Trick Out Your KDE Desktop
  Understanding the YAST Software Module Options
  Updating Your Software with Red Carpet
  Using dsbk on Linux and Unix
  Using iFolder to Synchronize Firefox Bookmarks
  Using Multiple Swap Partitions In 2.4
  Using openSSH to Securely Access Remote Systems
  What FTP client should I use on Linux?
  What Is Logical Volume Management?
  What is so great about Firefox?
  Which Graphic Formats For What?
  Windows Shortcuts for Firefox Tabs on Linux
  Windows to Linux: A Beginner's Guide
  Windows Users Can Feel at Home Exploring Files in Linux
  WLAN interface as the Default
  Work With User Selection Icons In KDM
  YAST Online Update De-Mystified

Technical Information
 Move Your /home to Another Computer

Printer-friendly version

Posted: 16 Mar 2005

Having bought a new machine, I was looking for a cool program to migrate my user settings from my old box to the new one. I needed something that would keep all my tweaks to KDE, my Evolution email, and my GAIM settings. A simple thought from a Linux-savvy friend of mine brought me to the realization, "Hey! I don't need a special program to do this!"

If you need to back up your settings or migrate them to a new machine, this tutorial will help. My aim is to explain a quick, painless method of doing this.

For this exercise, 'old machine' refers to the computer that has the current user data on it. This is the machine whose data you are going to back up. Conversely, 'new machine' refers to the machine to which you are going to move and restore your data.

First, log out of your window manager, and go back to your login manager. In KDE, you can do this by clicking on the K Menu, and clicking LOGOUT. Click END CURRENT SESSION from the window that appears. You are then taken back to your login screen. In Gnome, click on the SYSTEM menu, then the LOGOUT [username] option. In the window that comes up, select the LOGOUT radio button, and click OK.

You should now be back at your LOGIN window. What we need to do now is invoke one of your command-line terminals. Press CTRL+ALT+F1. You should never, ever log in as root. However, because we cannot have our user logged into the system, at this time, we are going to log in as root:

Welcome to SuSE Linux 9.2 (i586) - Kernel 2.6.8-24.11-kefault (tty1).

linux login: root
password:
Last login: Fri Mar 11 09:28:24 on tty1
Have a lot of fun...
linux:~ #

At this point, it might be a good idea to make sure no other users than root are logged in. Type in 'who' and press ENTER:

linux:~ # who
root     tty1            Mar 14 14:45
linux:~ #

You should only see the 'root' user logged in. If other users are logged in here (especially the user whose data you are working with), the process will abort and throw errors at you.

Go to your /home directory:

linux:~ # cd /home
linux:/home # 

Next, create a gzipped tar archive of your home directory. Mine is called 'smorris', so that's what I'll use. Replace 'smorris' in the example with your own username:

linux:/home # tar -cjf home.tar.gz smorris

List the directory's contents to see your archive:

linux:/home # ls -lh
total 49M
drwxr-xr-x   5 root    root   136 Mar 14 14:55 .
drwxr-xr-x  27 root    root   632 Mar 14 11:39 ..
-rw-r--r--   1 root    root   49M Mar 14 14:55 home.tar.gz
drwxr-xr-x  30 smorris users 1.5K Mar 14 11:42 smorris

You now have a gzipped tar archive of your home directory. This archive will have most (if not all) of your preferences for the applications you have installed. It will probably have all of your email messages in it. IM chat logs can also be found in the archive. There are two things you can do from here. You can put it on a CD as a backup of personal data. Alternatively, you can copy it to another machine and unarchive it, restoring to that machine all of your preferences. It is the latter option that we will execute here.

Go over to the new machine to which you are going to copy the archive. On this machine, I will assume that you already have created a user with the same name as on the other machine. For example, my username is 'smorris'. I have this user on the old machine that I am backing up. I also have created this user on the new machine where I am restoring the backup. Log in as root (normally, this is not good practice, but is necessary here). You might want to do this in the same manner as you did with the old machine, above. Once you are logged in, make sure there is an ssh daemon running. To do this, open a terminal window. At the command prompt, type 'ps aux | grep sshd' and then press ENTER:

linux:/home # ps aux | grep sshd
root      4191  0.0  0.4  5144 2068 ?        Ss   12:30   0:00 /usr/sbin/sshd
root      6154  0.0  0.1  2604  704 pts/2    S+   16:21   0:00 grep sshd
linux:/home #

Look at the first line of the output. Over towards the right, you see '/usr/bin/sshd'. This is our ssh daemon.

If you do not see this, you'll want to run it. To run the ssh daemon, type '/etc/init.d/sshd start' and press ENTER:

linux:/home # /etc/init.d/sshd start
Starting SSH daemon                                     done
linux:/home #

You should see the ssh daemon starting up as in the above example.

Once you're sure the ssh daemon is running, we're ready to copy the file to the new machine. For this step, you will need to know the IP address of the new machine. Still at the new machine, type '/sbin/ifconfig' and press ENTER:

linux:/home # /sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:6E:6C:66:62
          inet addr:137.65.68.1  Bcast:137.65.71.255  Mask:255.255.252.0
          inet6 addr: fe80::20c:6eff:fe6c:6662/64 Scope:Link
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:168221 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21408 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:35849611 (34.1 Mb)  TX bytes:2336595 (2.2 Mb)
          Interrupt:5 Base address:0x4000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:111 errors:0 dropped:0 overruns:0 frame:0
          TX packets:111 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:11519 (11.2 Kb)  TX bytes:11519 (11.2 Kb)

linux:/home #

There are two sections, 'eth0' and 'lo'. Completely disregard the 'lo' section. In the 'eth0' section, the second line starts with 'inet addr:' and has the IP address immediately after it. In my case, it is 137.65.69.1.

Go over to the old machine (the one with the home.tar.gz backup on it). You should still be at a terminal.

On this machine, initiate the file transfer. Type 'scp home.tar.gz root@137.65.69.1:' and press ENTER. Remember to replace the IP in this example with the IP of your new machine. Note the trailing colon. It is required:

linux:/home # scp home.tar.gz root@137.65.68.1:
The authenticity of host '137.65.68.1 (137.65.68.1)' can't be established.
RSA key fingerprint is bd:8c:a0:98:e5:0f:22:74:27:fb:b0:cb:ef:c7:6e:4f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '137.65.68.1' (RSA) to the list of known hosts.
Password:
home.tar.gz                                100%   49MB  12.2MB/s   00:04
linux:/home #

Now, head back over to the new machine. Move the archive from the /root directory to the /home directory, and then go to that directory:

linux:~ # mv /root/home.tar.gz /home
linux:~ # cd /home
linux:/home #

Before we go any further, let's just make sure noone else is logged into the machine:

linux:/home # who
root     tty1            Mar 14 14:45
linux:/home #

The 'root' user should be the only one logged in.

Next, let's rename the folder that already exists for the user. That way, we can restore it later if something goes awry:

linux:/home # mv smorris smorris.1
linux:/home #

Now, unarchive the file:

linux:/home # tar -xjvf /home.tar.gz

You'll see a ton of stuff scroll up the screen.

When it finishes, you have restored your user's settings to that computer.

Once again, let's just make sure you have a user account that uses that directory as their home directory. You can check this by running the following command. Remember to replace 'smorris' with your username:

linux:/home # cat /etc/passwd|grep smorris
smorris:x:1000:100:Scott Morris:/home/smorris:/bin/bash
linux:/home #

You can see that there is a user 'smorris' that uses '/home/smorris' as its home directory.

Now, you can reboot the machine (type 'shutdown -r now' and press ENTER). When your machine reboots and the login manager comes back up, log in as your user (not root). When you run applications, they should already have all of the preferences and settings that you had on your old system. Some programs will even have items in the 'most recently used' menus that you had open on your old machine.

If you want a quick and dirty way to make backups, this will do it. If you want to migrate your user data, preferences, settings, email, etc., from one computer to another, this will get it done. In any case, this is a nice tool for your toolbelt.






Portal posiada akceptację firmy Novell Polska
Wszystkie materiały dotyczące produktów firmy Novell umieszczono za zgodą Novell Polska
Portal has been accepted by the Novell Polska
All materials concerning products of Novell firm are placed with Novell Polska consent.
NetWare is a registered trademark of Novell Inc. in the United States and other countries.
Windows is a trademark or a registered trademark of Microsoft Corporation in the United States and other countries.
Sybase is a registered trademark of Sybase Inc. in the United States of America.
Other company and product names are trademarks or registered trademarks of their respective owners.