Migrate FOG
This article explains how to move FOG Settings & images from an old box to a new box. This is more safe and more sure than attempting an OS upgrade, which can be risky and leave you with a broken server.
Related Articles & Tools:
- There's a tool in here for updating IPs as well. [https://github.com/FOGProject/fog-community-scripts]
FOG 1.2.0 to 1.3.0
Building the new server
The first step in this process is building a new FOG server using the latest version of your chosen Linux distribution. I would recommend CentOS or Debian. Go through the normal steps of setting up the OS. do not create a user called fog - it will cause you nothing but pain later on. If you're installing Debian or Ubuntu, name the user "tech" or "Administrator" or whatever your first name is, like "Bob". If you're using CentOS or Fedora or RHEL, no extra user is necessary, just set a good root password. Name the server fog-server if possible, and set a static IP or create a DHCP reservation for the server. After an IP is set, use your DNS server and create an 'A' record for the server's name and IP. To install FOG, follow an appropriate installation manual or the Upgrade to trunk article.
Transferring images & database
We will use NFS for both of these items, because the new FOG Server provides an NFS share - and this approach is uniform across the different distributions.
Via Terminal or SSH on the old FOG server, mount the new fog server's /images/dev directory to a local directory on the old server called /new. Where x.x.x.x is the new fog server's IP address.
mkdir /new mount /new x.x.x.x:/images/dev
We will export the database and move the export to the new server. This is performed on the old FOG Server. There are a few different examples of how to do this below, depending on if you're using a password or not, and how MySQL is configured. One of them will work for you.
#No password. mysqldump -D fog > /new/fogdb.sql #Password with root user. mysqldump -D fog -u root -p > /new/fogdb.sql #No password, localhost. mysqldump -D fog -h localhost > /new/fogdb.sql #No password, local loopback. mysqldump -D fog -h 127.0.0.1 > /new/fogdb.sql #Password with localhost. mysqldump -D fog -h localhost -u root -p > /new/fogdb.sql #Password with local loopback. mysqldump -D fog -h 127.0.0.1 -u root -p > /new/fogdb.sql
Now to move over the images. Again, this is performed on the old FOG server. The more images you have, the longer the below command will take to execute.
copy -r /images/* /new