LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-17-2010, 03:13 PM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,190

Rep: Reputation: 96
Moving user account to new install of Linux?


I am beginning plans to upgrade my "production" desktop from Ubuntu 9.10 to 10.04 LTS. Based on what I have read and experienced with "upgrades" it is better to install the new version from scratch. That is what I plan to do. The next task is to install the various additional programs I wish to have. I can make a list of them and do the installs no problem.

So now I get to the question of my user account information. I have my current system built with the following file systems:

/ (for the OS)
/home (for my account)
/data (for all "data" including Firefox and Thunderbird profiles, OpenOffice.org documents and other data files)

Moving my "data" to the new OS will not be an issue. My user account information is stored in /home/ken. Can this be moved to the new OS? I would like to avoid having to redo gnome and program preferences and configurations, icons on the panel, saved passwords, ssh bookmarks and other stuff which Linux has stored in /home/ken.

I have created an Ubuntu virtual machine and tried a couple of approaches to transferring the files under /home/ken. The results were not promising. Is moving my profile a practical idea or should I just take a couple of hours and tweak everything on the new OS to my liking?

TIA,

Ken

p.s. If I rebuild my profile are there any things I can do to make it "portable" in the future? For when I move to 12.04 LTS?
 
Old 05-17-2010, 03:23 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,634

Rep: Reputation: 519Reputation: 519Reputation: 519Reputation: 519Reputation: 519Reputation: 519
Yes, feel free to move /home/ken. There should be few issues. Just make sure file ownership is the same (not an issue if you're the only user, but watch for numeric ID differences). I've done exactly what you're proposing and it went pretty well. However there may be some issues if e.g. major software versions have changed.
 
Old 05-17-2010, 03:31 PM   #3
fruttenboel
Member
 
Registered: Jul 2008
Posts: 270

Rep: Reputation: 48
Quote:
Originally Posted by taylorkh View Post
I am beginning plans to upgrade my "production" desktop from Ubuntu 9.10 to 10.04 LTS. Based on what I have read and experienced with "upgrades" it is better to install the new version from scratch. That is what I plan to do. The next task is to install the various additional programs I wish to have. I can make a list of them and do the installs no problem.

So now I get to the question of my user account information. I have my current system built with the following file systems:

p.s. If I rebuild my profile are there any things I can do to make it "portable" in the future? For when I move to 12.04 LTS?
Be VERY careful here!

If you add users via useradd or something similar use the exact same sequence as in the old system. If, on the old system, you installed users ken, bob and joe (in that order) and on the new system the same names but now in the order bob, ke, joe, then bob gets kens user space and vice versa. The names are just shortcuts coupled to the user ID.

For the rest: it's quite safe to keep the old home directory.

Still, what I usually do is:

- rename the old /home to /oldHome
- do the install (with a new /home)
- later copy all relevant files from /oldHome to /home

Or: put the full /home in a tar file and keep it somewhere on the disk (or on a DVD or tape) so you can later access it.
 
Old 05-17-2010, 03:39 PM   #4
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,037

Rep: Reputation: 756Reputation: 756Reputation: 756Reputation: 756Reputation: 756Reputation: 756Reputation: 756
I would think that you have two choices: create a tar archives of your entire /home directory then gzip the archive and copy it to a flash or CD-ROM or DVD drive (and do the same with any other directory tree you want to "save"); or (and I'm not sure you can do this with Ubuntu) see if you can selectively not format and build a file system on the partitions you don't want wiped out. That is, you want to let the installation wipe out and overwrite the root but not /home or /data -- see if you can do that (if you can't, then go with the archive method).

You don't want to simple copy the directory trees to a flash driver (or CD-ROM or DVD or whatever); create tar archives, gzip them and copy those to your media. Then, get your system configured (add user accounts and all that), then extract the archives from the media something like
Code:
log in as root
cd /
tar xzfv /media/device/home.tar.gz
tar xzfv /media/device/data.tar.gz
Hope this helps some.
 
Old 05-17-2010, 04:14 PM   #5
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,190

Original Poster
Rep: Reputation: 96
Thanks AlucardZero, fruttenboel and tronayne,

As part of my nightly backup process I execute the following script line
Quote:
tar -cvpzf /quitelarge/_mirror/mirror1/home-ken.gz /home/ken 2>> /quitelarge/_mirror/tar-error.log
/quitelarge is a file system on a separate hard drive. mirror1 is a subdirectory which gets rolled over every night for 7 days giving me a 7 day history. That said, my first attempt to move my profile to the virtual machine went like this

- create VM with my account "ken" as the first user
- created a second user "zorro" as an administrator
- copied a home-ken.gz file to the VM by ssh
- logged in as zorro (so no files owned by ken were in use)
- renamed /home/ken to /home/ken.old
- unzipped/untarred home-ken.gz to /home/ken
- attempted to logon to the VM as ken

When I logged on I got a message
Quote:
Could not update /home/ken/.ICEauthority
followed by several other errors which I did not write down. I never got a panel to load. I killed the VM and replaced it with a copy I made before the experiment. Ready to try again

The second try I logged into the VM as ken and slammed the files from the old machine /home/ken over top of the files in the VM /home/ken. When I logged out and back in I at least got the panel although some programs were missing or had blank launchers (Firefox for example). Fonts were a little hosed up and the window control buttons were large and square (rather than small and round as in Lucid).

Obviously my process still needs some work. As to the /data - that data has migrated over the years from CP/M to DOS to Windows 3.1 to NT to Win 2000 to XP and then to Linux. The only file I recall loosing was a tax worksheet in Supercalc which got corrupted on a diskette from my Osborne. When I loaded it to my first 40 MB hard drive I did not realize that it was bad

Ken
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No access rights to delete or move files after re-install and moving from user folder sonicboy Ubuntu 5 01-18-2010 03:28 AM
[SOLVED] Moving files from one account to other mohitdaksh Linux - Newbie 6 10-05-2009 07:01 AM
Difference betwwen : Locked User Account & Disabled User Accounts in Linux ? avklinux Linux - Security 1 02-04-2009 02:30 PM
is it legitimate and allowed and can be done to make another user account set uid and gid to null 0 to make another root account with different name and possibly not damage the debian system creating and using that new account BenJoBoy Linux - Newbie 12 01-29-2006 10:02 AM
Moving user account info to a new server - advice please. Seventh Linux - Newbie 2 03-09-2005 09:38 AM


All times are GMT -5. The time now is 07:32 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration