Please note the new address for this forum : forum.excito.org. The old address redirects here but I don't know for how long. Thanks !
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

B2 home to B3 home folder

Got problems with your B2 or B3? Share and get helped!
Post Reply
Paul
Posts: 8
Joined: 23 Jun 2009, 16:45

B2 home to B3 home folder

Post by Paul »

Hi Guys,

I recieved today my new B3, now i want to copy the home folder (all users with mail) to my B3 home folder.
I spent almost all day searching this forum to find a answer but nothing easy to do.
I not that good with ssh or other command line stuff, so can somebody help me out wiht this.

Paul.
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: B2 home to B3 home folder

Post by Ubi »

Are both the new aNd old server connected on the same subnet?

The thing is that what you want to achieve is a simple job for someone with experience but could be a little tricky for novices, mainly because you have to fix the permissions differences between old and new machines
Paul
Posts: 8
Joined: 23 Jun 2009, 16:45

Re: B2 home to B3 home folder

Post by Paul »

Yep...

I tried to backup to a ip address (B3) as target with all the folders selected, but nothing happens.

Do you have a suggestion maybe I understand what to do.
Paul
Posts: 8
Joined: 23 Jun 2009, 16:45

Re: B2 home to B3 home folder

Post by Paul »

I found something

On the source computer (B2), type the next command in a terminal (do not press Enter yet):
tar cz -C/home your-username|nc -l -p 8888 -w 10


Explanation:
•tar is an utility for packing files
•cz creates such a packed file ("tarball")
•The tarball is compressed using the GZip algorithm to lower the file size.
•-C/home your-username changes the working directory to /home and puts the your-username folder in the tarball
•nc (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 (B3). To add the files to the target machine, type (do not run it yet):
nc 192.168.1.2 8888|tar xzp -C/home

•192.168.1.2 is the IP address of the source computer. To get its IP address, run: ifconfig on the source machine
•8888 is the port number as entered on the source machine
•xzp: extracts the GZip-compressed tarball while preserving permissions.
•-C/home: extracts the your-username folder to /home/your-username
•Optionally, add the -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 (B2)computer, press Enter to run the server command. Quickly switch to your B3 and press Enter to run the client command.

And this is working.... :mrgreen:

I did this also with web and storage.
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: B2 home to B3 home folder

Post by Ubi »

Very nifty solution, and also well documented.
You could have achieved the same thing with a simple rsync , but your solution is very hackery, and probably faster as well.
Still you did not solve your permissions issue. This could be nothing *if* your UIDs and GIDs on your old and new machines are identical. If not, you have some translating to do. FOr this, "find" is your friend

Code: Select all

find /some/folder -uid 501 -exec chown jack {} \;
Now you also need to stop saying you are not good with command line stuff. This was a rather advanced hack
Gordon
Posts: 1470
Joined: 10 Aug 2011, 03:18

Re: B2 home to B3 home folder

Post by Gordon »

Gotta love those issues that solve themselves :lol:
Paul
Posts: 8
Joined: 23 Jun 2009, 16:45

Re: B2 home to B3 home folder

Post by Paul »

Google is you're best friend :roll:

The coping was really fast, I had no premission issue's I had all the user with ther passwords already build on the new B3.
And the case was to transfer everything from B2 to B3 (upgrade) and now I'm using the B3 and the B2 is to play with.

The command line stuff was from a other site, it is that they explain wat to do otherwise I really don't know.

The next thing to do is to make a new certificate for outlook :oops:

Paul.
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: B2 home to B3 home folder

Post by Ubi »

Passwords have nearly nothing to do with permissions!!
johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: B2 home to B3 home folder

Post by johannes »

NIce work! Short sidenote:
When migrating the home partition the simplest trick is to create the same users again, and in the same order, then *ID:s will be the same and no permission problems.
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)
Gordon
Posts: 1470
Joined: 10 Aug 2011, 03:18

Re: B2 home to B3 home folder

Post by Gordon »

johannes wrote:NIce work! Short sidenote:
When migrating the home partition the simplest trick is to create the same users again, and in the same order, then *ID:s will be the same and no permission problems.
Would a Bubba system restore on the B3 of a Bubba system backup from the B2 accomplish this, Johannes?
johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: B2 home to B3 home folder

Post by johannes »

Gordon wrote: Would a Bubba system restore on the B3 of a Bubba system backup from the B2 accomplish this, Johannes?
Yes, if the both systems run on the same software version.
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)
Gordon
Posts: 1470
Joined: 10 Aug 2011, 03:18

Re: B2 home to B3 home folder

Post by Gordon »

To be honest, I find that answer a bit disturbing. Suppose I have a system backup that I made when on software version 2.5 and I find myself needing to replace the harddisk. Then I would have to use the rescue stick to install a new system on that disk, which is at software version 2.4 I think, and then run the updates which will get me straight to software version 2.6. At which point would I be able to restore my settings? Or would that not be possible at all?
johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: B2 home to B3 home folder

Post by johannes »

I understand the issues on this, but it's also difficult to keep this backup identical since every version adds a new level of features (that needs to be included in the backup). I can also add that it most likely will work well with for instance 2.4.1 -> 2.6, but we made a major re-vamp of the backup feature in 2.4, so moving from pre 2.4 to post will probably work bad or not at all.
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)
Gordon
Posts: 1470
Joined: 10 Aug 2011, 03:18

Re: B2 home to B3 home folder

Post by Gordon »

Okay, but if I understand this correctly the restore function itself is not version dependent. Right?

So essentially that would mean it is safest to apply the restore as early as possible because then it can only add settings to non-existing services, while running a restore on a newer software version might possibly delete a service account that was added later on (and thus cripple that service).
johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: B2 home to B3 home folder

Post by johannes »

Apart from the breach between 2.2 and 2.4 and yes, you can do this.
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)
Post Reply