# Post Installation Question



## kantshoot (Nov 19, 2011)

Hello, 

I recently set up a new system with 7.4-RELEASE.  I would like to move the existing files from the old server running 3.2-RELEASE over to the new server.  Can someone please tell me the easiest way to do this.  I have never attempted this before.  Many thanks.


----------



## wblock@ (Nov 19, 2011)

Back up old system and restore only data files on the new one is the preferred method.  Usually that's with dump(8)/restore(8).  See Backup Options For FreeBSD.

Don't know if it's even possible to use scp(1) or rsync(1) on a system that old.


----------



## kantshoot (Nov 23, 2011)

*Installing and upgrading FreeBSD.*

Thanks Warren, 

I did read about dump(8) in the FAQ section but am not knowledgeable enough to transfer the files in the manner recommended.  I reviewed your links regarding dump via SSH and have a question.

The new system has the following directories:

/, /dev, /temp, /usr, /usr/home, /var.

If I use dump to gz the files from each directory to the new server under my acct


```
# dump -C16 -0uanL -h0 -f - /    | gzip -2 | ssh -c blowfish user@otherhost dd of=root.dump.gz
```

Can I do the following to restore the files to each of the new existing directories:


```
# ssh -c blowfish usr@otherhost gzcat root.dump.gz | (cd / && restore -ruf -)
# ssh -c blowfish usr@otherhost gzcat root.dump.gz | (cd /dev && restore -ruf -)
# ssh -c blowfish usr@otherhost gzcat root.dump.gz | (cd /temp && restore -ruf -)
# ssh -c blowfish usr@otherhost gzcat root.dump.gz | (cd /usr restore -ruf -)
# ssh -c blowfish usr@otherhost gzcat root.dump.gz | (cd /usr/home && restore -ruf -)
# ssh -c blowfish usr@otherhost gzcat root.dump.gz | (cd /var && restore -ruf -)
```

The restore recommends making files:


```
# mkdir /tmp/root /tmp/var /tmp/usr
# ssh -c blowfish usr@otherhost gzcat root.dump.gz | (cd /tmp/root && restore -ruf -)
# ssh -c blowfish usr@otherhost gzcat var.dump.gz  | (cd /tmp/var  && restore -ruf -)
# ssh -c blowfish usr@otherhost gzcat usr.dump.gz  | (cd /tmp/usr  && restore -ruf -)
```

I do not understand why I need to first set the files up under a tmp directory when the directories the file need to be in are already created.  Am I wrong?


----------



## SirDice (Nov 23, 2011)

Don't use dump. It's fine if you want to backup complete filesystems but the way you're doing it now will turn your new 7.4 machine into a 3.2 one.

Find the files you need to backup and use tar(1). This can also be done 'remote':
[cmd=]ssh usr@otherhost tar -C /usr -cf - home | tar -C /usr -xvf -[/cmd]
This will pull /usr/home from otherhost to the local machine's /usr/home.


----------



## wblock@ (Nov 23, 2011)

kantshoot said:
			
		

> Thanks Warren,
> 
> I did read about dump(8)in the FAQ section but am not knowledgeable enough to transfer the files in the manner recommended.  I reviewed you links regarding dump Via SSH and have a question.
> 
> ...



/dev is a device directory, it does not need to be backed up.  /tmp maybe not.  This also ignores the fact that dump works on filesystems, not directories.



> If I use dump to gz the files from each directory to the new server under my acct
> 
> 
> ```
> ...



There's a chance that if a system that old even has ssh, it won't be able to talk to a modern ssh without changing options.  I don't know.



> Can I do the following to restore the files to each of the new existing directories:
> 
> 
> ```
> ...



That would be a mistake, because it is only the data files that need to be restored.  Besides that, you can't back it all up to one file anyway.  Filesystems, not directories.



> The restore recommends making files:
> 
> 
> ```
> ...



The backup/restore examples show how to copy directly without creating files.  But that is a mistake, because the new system doesn't need all the old files (FreeBSD 3.2 versions of ls, cp, etc).  It just needs the data and user files.  The reason to copy everything is to protect from hardware failure, which is to be expected with a system that's twelve years old.  With a complete backup, there's a chance you could get the old system running again on new hardware (maybe) or in a VM (better).


----------



## kantshoot (Nov 24, 2011)

Ok, thank you for your insights. I will try move the /usr and /usr/home files over and do a test.  Worse case is I would have to do an rm if I make a mistake.


----------



## kantshoot (Nov 24, 2011)

You know that same thought occurred to me SirDice. It was a question I was going to ask today regarding the new version being overwritten during a copy.  I will man up on the tar(1) docs and try test this.  It sounds less complicated than I thought.  It's my lack of a sound unix foundation haunting me...


----------



## wblock@ (Nov 24, 2011)

/usr has lots of things that probably shouldn't be copied.  Locate the data directories and just copy those.


----------



## SirDice (Nov 24, 2011)

tar(1) is pretty easy to use. Basic commands:
[cmd=]tar -C /base -czf basedir.tgz dir1[/cmd]
This will create an archive called basedir.tgz of the directory /base/dir1/.

[cmd=]tar -zxvf basedir.tgz[/cmd]
This will 'unpack' the basedir.tgz archive in the current directory.


----------

