Upgrade from 0.32 to 1.2
Upgrading from 0.32 to 1.2, it is well known usually that the fact that the OS is stored in the image info rather than the host will be an issue, but there is a function handling that in the schema updater. Problem is, I got all my images set with OSID 0… I’ll debug more about that, but I wonder why this wasn’t done in SQL rather than having to call some PHP like this (we’re talking schema upgrade 29).
Here’s an example that tries to link the images with the OS of the host that was the last to finish a imaging task.
SET imageOSID = (
[INDENT=1]SELECT DISTINCT hostOS[/INDENT]
[INDENT=1]FROM hosts LEFT JOIN imagingLog ON (imagingLog.ilHostID = hosts.hostID)[/INDENT]
[INDENT=1]WHERE hosts.hostImage = images.imageID[/INDENT]
[INDENT=1]ORDER BY ilFinishTime DESC[/INDENT]
WHERE imageOSID = 0
And that works, if you apply it before deleting the hostOS, whereas the PHP code leaves the images set to 0 for imageOSID…
Wayne Workman last edited by
For future readers: https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG
the “And new things, now my hosts don’t appear in the list, great… They do in the report, but because of the MACs, it seems they won’t get displayed…” one was due to me using a schema from SVN when I tried to pinpoint the problem. But the schema updater thing I reported first was consistent… But I’d need to try again on an old .32 file to see it happening… I haven’t kept all those
So this problem really isn’t/wasn’t a problem?
OK, that’s my fault, I used the schema updater from SVN in the end… not clever.
And new things, now my hosts don’t appear in the list, great… They do in the report, but because of the MACs, it seems they won’t get displayed…
And another bug (we need a mailing list, or a bug tracker):
all my upgrades were configured as: “DHCP will NOT be setup but you must setup your…”
And the process overwrote the config (backing them up before doing so, but still, annoying.)
I can’t really figure why the ->save() doesn’t work, so here’s the patch to make it work using pure SQL.
This post is deleted!