You are not logged in.

#1 2009-04-14 09:13:33

quantumphaze
Member
From: Melbourne, Australia
Registered: 2008-11-14
Posts: 175

Migrating across different $HOMEs

I just bought myself a new laptop. Migrating all my settings should be as simple as just copy/paste. However I have a few concerns about my particular setup.

Firstly, my old laptop is i686 and the new one is x86_64. This is probably of little concern as far as userspace configs go.

But the bigger problem would be that my home directory on the old laptop is /home/andrew-arch and on the new one it is /home/andrew
I did this on the old laptop deliberately because I wanted to be able to dual boot with Ubuntu without there being any strange conflicts due to different package versions getting confused over the config files. So I changed my $HOME to andrew-arch in /etc/passwd and created symlinks across to Ubuntu's /home/andrew/ for doc folders and a few configs that wouldn't break (eg: .mozilla and .wine). It worked fine since I used the same UID.

The way I see things breaking is that random config files may have absolute directories in them and will do weird things if all of a sudden /home/andrew-arch doesn't exist any more.

Does anyone have any advice on how to go about this in the least hackish way? I want to have my new %HOME=/home/andrew because the bash prompt doesn't show ~ $HOME if it's different to the username. The easiest way I could fix it is to just symlink a /home/andrew-arch to the real one but it's still hackish.
What I would like the most is to do a recursive plain text find/replace on every instance of everything. Would that be safe though?


▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▏▎▍▌▋▊▉█▇▆▅▄▃▂▁

Offline

#2 2009-04-14 18:59:19

darthaxul
Member
Registered: 2008-09-24
Posts: 156

Re: Migrating across different $HOMEs

Sounds tricky, but I would make it simple and just create a copy of your home directory every time u log in just in case something gets out of wack.

Offline

#3 2009-04-14 19:38:41

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Migrating across different $HOMEs

find/replace would be safe IMO - just make a note of what gets changed, and keep backups (of course).

Offline

#4 2009-04-15 01:05:50

quantumphaze
Member
From: Melbourne, Australia
Registered: 2008-11-14
Posts: 175

Re: Migrating across different $HOMEs

Don't worry about backups. That is what the old laptop is. I'll burn the lot to DVD before I wipe it to give to my mum.

I found the fastest way to do the actual transfer itself is to set up NFS on the old laptop (read only) and mount it in /home/andrew-arch-copy on the new one and then cp -fv /home/andrew-arch-copy/* /home/andrew-arch-copy

Does anyone know what command would do the plain text find/replace? I'll just symlink a second home dir as a temporary measure until I find out how.


▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▏▎▍▌▋▊▉█▇▆▅▄▃▂▁

Offline

#5 2009-04-15 06:11:04

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Migrating across different $HOMEs

sed

Offline

#6 2009-04-15 08:32:10

quantumphaze
Member
From: Melbourne, Australia
Registered: 2008-11-14
Posts: 175

Re: Migrating across different $HOMEs

tomk wrote:

sed

yay, learning time

Everything is working well enough with just a symlink workaround in place. I can take my time to do the find/replace on everything. So far the only thing that is observably ignoring $HOME is Dolphin. Clicking Home in the Places box still goes to /home/andrew-arch but since it's a symlink it works.


▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▏▎▍▌▋▊▉█▇▆▅▄▃▂▁

Offline

#7 2009-04-15 08:40:25

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Migrating across different $HOMEs

quantumphaze wrote:

Does anyone know what command would do the plain text find/replace? I'll just symlink a second home dir as a temporary measure until I find out how.

cd /home/andrew/
grep -RHi /home/andrew-arch .* | cut -d\: -f1 | xargs sed -i 's/\/home\/andrew-arch/\/home\/andrew/g'

Untested, no guarantee etc etc...

Offline

#8 2009-04-15 09:33:24

quantumphaze
Member
From: Melbourne, Australia
Registered: 2008-11-14
Posts: 175

Re: Migrating across different $HOMEs

Thanks for that, I will modify it to go through individual directories (.kde4 and stuff) for safety.

Grep is returning a few errors when I run that part by itself when it encounters something funny (like symlinks to / in an old wine-prefix in the trash giving permission denied errors).

Last edited by quantumphaze (2009-04-15 09:35:58)


▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▏▎▍▌▋▊▉█▇▆▅▄▃▂▁

Offline

Board footer

Powered by FluxBB