Upgrading from FOG 0.32 to 1.3.x
-
Hi everyone,
I’m currently on
- Ubuntu Server 10.04.
- FOG 0.32
and would like to upgrade to
- Ubuntu Server 16.04.
- FOG 1.3.0 or even 1.3.1
- while keeping the hosts and images from 0.32
I’m looking for best practice tips to do that. I do have a VM to test it all with. This VM is not my actual FOG server, so no worries here. I already read on the wiki that it is recommended to freshly install Ubuntu instead of upgrading. Has anyone successfully upgraded Ubuntu and FOG instead of a fresh installation?
Would the following procedure work?
- Export hosts and images from FOG 0.32
- Uninstall/purge FOG 0.32
- Upgrade to Ubuntu 16.04
- Install FOG 1.3.x
- Import hosts and images from FOG 0.32
Should I go with FOG 1.3.0 or directly to 1.3.1 RC?
Any other tips?
Thanks in advance.
-
If you have the resources, just spin up a new clean instance of ubuntu 16.04 and FOG 1.3.1-RCx instead of upgrading your existing server.
The logic here is two folder.
- You are versioning over a large gap both for ubuntu and FOG. This can be done, but you will spend more time rolling the OS from 10.04 to 16.04 than just spinning up a new server.
- If something happens during the upgrade you will loose access for imaging. Keeping your legacy FOG server functional will give you a working FOG system while creating your new FOG server.
You can move the images between fog servers OK, but unless you have a huge number of fog clients, you would be better served by just recreating the hosts in your new fog server instead of copying the DB over. Also with the images created with 0.3x, you would be better served by converting them to the newer FOG 1.3.x format. This will save on deployment times since the new format deploys quite a bit faster than the old format.
-
For future readers: https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG
-
I now have a VM with Ubuntu Server 16.04. and FOG 1.3.2 for testing.
I exported the hosts from 0.32 (via MYSQL dump) and imported them into 1.3.2. If I go into the fog database from the command line, I can see, that the hosts are actually there (names, MACs, descriptions etc.), but in the FOG web interface no hosts are showing („0 results found“). Any ideas?
-
@madeyem There’s some maintenance commands for cleaning out junk data - this might help you, it couldn’t hurt. They are here: https://wiki.fogproject.org/wiki/index.php?title=Troubleshoot_MySQL#Hosts_think_they_are_not_registered_.2F_can.27t_register_.2F_Already_Registered_.2F_other_registration_weirdness
-
The command
DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC`);
deleted all hosts I had imported, so I guess there is something wrong with the hostIDs? Any idea how I can fix this while importing hosts from 0.32?
-
By this time, I’m pretty sure, that the problem lies in the different database structures in FOG 0.32 and 1.3.x. After I imported the hosts from 0.32, not only are they not listed on the web interface, but I also can’t add a host manually anymore, so the import from 0.32 apparently messes up the databases somehow. I installed phpmyadmin to check the databases after the import and the field hmHostID from hostMAC is completely empty. If you add a host manually (it works before the import), this is not the case and it shows up properly on the web interface.
I guess, as long as someone doesn’t write something up, that particularly makes it possible to import from the old into the new database structure, we won’t be able to successfully import the hosts from 0.32.
If someone comes up with a way, that is working, please share.
-
@madeyem said in Upgrading from FOG 0.32 to 1.3.x:
By this time, I’m pretty sure, that the problem lies in the different database structures in FOG 0.32 and 1.3.x.
I don’t think so. FOG 1.3.0+ has code in it to upgrade any previous version of the database to the current version.
If you’re only exporting a single table, that would explain why it’s not working. Grab the entire database, the commands are in the link I posted earlier.
I guess, as long as someone doesn’t write something up, that particularly makes it possible to import from the old into the new database structure, we won’t be able to successfully import the hosts from 0.32.
The link I posted earlier is a complete tutorial for migrating fog.
-
Ok, I will try and report back.
-
I have to take back, what I said earlier.
When I first tried to migrate the database, I apparently did something wrong while exporting the db, because the size of the dump wasn’t nearly as big as it is now, when I tried it again. I now was able to successfully import the database and I have hosts, image definitions and users showing up properly in the web interface.The next step is to perform all of this on my actual FOG server, as this was only a test with a VM.
Thanks for the help everyone!