# Migrating Freebsd 6 data to new Freebsd 8 machine



## d3sir3 (Jun 10, 2010)

Hi all,

I had to migrate all data(web server, mail server etc) from a machine with Freebsd 6 to a new machine with a clean install of Freebsd 8. I'm a newbie and I really need some advices from experienced users. Please help me.
Thank you!


----------



## ohauer (Jun 11, 2010)

Compare/sync your /etc/master.passwd and /etc/group file to have all accounts on the new machine before you use rsync for other data, then rebuild the passwd.db (by executing vipw save and quit).

Figure out all the packages on the old machine (how they are configured/build) and what changed if something is outdated.
For self build packages you can get a good overview with the options file in /var/db/ports.
Example postfix, is it a stock postfix (default options or customized postges/mysql, vda ...) same for all the other packages.

Transfer /var/db/ports directory and the /usr/local/etc folder for example via rsync to the new machine, then install/build all packages on the new machine (start with major ports for example postfix, dovecot, apache).

Datebases => dump => restore on the new machine => test with sql command interface.
Data (/var/mail, /usr/home and other data directories can be transferd with rsync)

Test all applications on the new machine if anything is OK you can swap the IP from both machines and test again.

To get a quick overview if a important package is missing
`# pkg_info -qoa | sort > packages_6`
`# pkg_info -qoa | sort > packages_8`

transfer packages_6 to the 8 host and
`# diff -u packages_6 packages_8| more`

Make sure you have all the time access to both machines to fix or swap back.

It is nearly impossible to write a full howto and what to transfer, you have to know this for your machine.


----------



## kniveton (Jun 22, 2010)

*slightly different question*

what about migrating from 6 to 8 using a full source build? Any particular caveats? Should I go through 7 first or directly from 6 to 8 is ok?


----------



## expl (Jun 22, 2010)

You can build 8 from 6, no problem. But I suggest that you remove all your ports that you have installed and read the upgrading from source manual in FreeBSD handbook.


----------



## fronclynne (Jun 22, 2010)

6.x->8.x should work.  If you're not pressed for time, go ahead and run your buildworld, buildkernel, make sure you have a 6.x kernel to fall back on, install the new kernel, boot into single-user mode and before you run installworld try to execute /usr/obj/usr/src/bin/sh/sh (I believe), and maybe a few others.  You can pretty easily back out of a borked kernel, but a screwed up world usually means a fixit disk.

Another option is to use freebsd-update(8) to get to 8.x and then rebuild from source to get exactly where you want to be.


----------



## phoenix (Jun 22, 2010)

While it might (or might not) work to upgrade directly from 6.x to 8.x, the recommended (safer) route is:

upgrade to the latest 6.x release
upgrade to 7.0
upgrade to the latest 7.x release
upgrade to 8.0

The upgrade process is only guaranteed to work for X.A --> X.Z, and from X.Z to Y.0.  Anything else is unsupported and may or may not work.

There's nothing stopping you from trying, but you can't complain if things break and you lose everything.


----------



## Paul-LKW (Jun 23, 2010)

If you are running Samba too and have Chinese Character file name/direcctory you should also convert it from the Samba tools to UTF8 too or you will see Garbled character in your Windows Clinet.


----------



## kniveton (Jun 23, 2010)

Hmm, this is my home gateway which contains my mail server and a whole bunch of services for my home. It started out as a 4.x box. So removing all ports isn't really an option. This is why it's been sitting at 6-stable for some time, but would like to go to 8 now. I may go through 7.0->7-stable just to be on the safe side.


----------



## teckk (Jun 23, 2010)

Seriously, it may be easier, safer, and less stressful to back up everything you want to keep from the 6 install then make a fresh 8 install.

Or better yet, if you have another HD, make a fresh 8 install on it. Then transfer all you need from the 6 HD to it. If something goes wrong you just have to put the working 6 install back in. Just my 2 cents. I don't like surprises.


----------

