Migrate PM to VM 1.2.0
-
I am having trouble migrating to a VM.
I backed up the database in Fog Configuration --> Configuration Save.
And backed up the \images folder.
I made the VM, installed the same version of fog on the VM, imported the database, and moved the images folder over.
I also did what i read on this page https://community.spiceworks.com/how_to/2631-moving-a-fog-server-to-new-hardware
Copy the contents of the images folder which is /images and place them in the /images folder on the new server.
(This is assuming that you are using the default storage and have not set up any additional)
After that you will need to change the permissions:
sudo chown -R fog /images
sudo chmod -R 755 /images
sudo chmod -R 777 /images/devnote: When I did my first run on the new server I got a failure to mount nfs volume error the fix is
touch /images/dev/.mntcheck
touch /images/.mntcheckI did all of that and my images are still not showing up. And I dont even think the database export/import took either because none of my settings in the Fog Confiuration --> Fog Settings page showed up.
I either don’t understand the capabilities of the database export/import, or it didnt work.
I thought from the page here https://forums.fogproject.org/topic/2714/info-on-fog-server-disaster-recovery/3
If you make backups of your Images folder (just copy paste, or compress a copy and then move it) and your database, then you have everything you really need.That this would be all I need, and the database export/import would take care of everything except the images folder.
Am I incorrect assuming this?
Any help is greatly appreciated!
-
You need to export the image list. Go to image management, export images, then import them in the VM.
-
Lets take a step back here.
You are doing a p2v migration. What hypervisor are you using? If you are using vmware there is a much easier path, unless you are doing an OS upgrade at the same time.
-
Be aware that you need the files in /opt/fog too. There are the snapins that need to be moved.
But with your current error it sounds like you don’t have the correct files exported for NFS.
from your new server linux console you want to run the following command
showmount -e <ip_address_fog_server>
That should give you something like this:
Export list for <ip_address_fog_server>: /images/dev * /images *
If it does not then you need to update your exports file.
vi /etc/exports
and add in:
/images *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure,fsid=1,) /images/dev *(rw,sync,no_wdelay,no_root_squash,insecure,fsid=2,)
-
@george1421 I’m using XenServer 6.1 and Ubuntu 12.04 64-bit
-
@Quazz When I go to Image Management I don’t have the option to export.
-
@george1421
I got this when i entered: showmount -e <ip_address_fog_server>
/images/dev *
/images * -
OK rereading your OP multiple times, the first thing you need to get settled is the database export / import. You need to get the settings and passwords into your new system. Without the database the rest of the bits are pointless.
If you are running fog 1.2.0 or a trunk release then there is a built in function to export the configuration from within the gui and then import into your new server. There is no need to use the spiceworks method. That is for the 0.3.x and older release.
GO into the Fog Configuration and select the Configuration Save option that will download the fog_backup.sql to your computer, then go to the new server and upload the settings.
-
If you don’t have too much images, here is how I do :
- install your new server with different IP (old server will still be usable and never think you won’t need to deploy. I did once… 15 computers needed it…)
- then there is 2 way for images :
- Mount the directory on new server
mkdir <directoryname> sudo mount -t nfs -o rw <OldFogServerIP>:/images /home/<youruser>/<directoryname>/ cp -r <directoryname>/ Images/
OR
- REPLICATION !!!
Add new server storage in same group as the storage of the old storage under old GUI.
Don’t set new storage as MASTER or… you are dead ! lol
Check logs : /opt/fog/log/fogreplicator.log ou in GUI http://fogserver/fog/management/index.php?node=about&sub=log then “Image Replicator”.(OR… the most simple, use Winscp ! lol)
For the host :
Export from old server : Report Management -> Host List -> Format CSV
Edit the file to have : “MAC Address (ie: 00:11:22:33:44:55) *”,“Hostname *”,“IP Address”,“Description”,“Image ID”*These two things can be enough
Don’t leave this line in it.
Import in new FOG server : Host Management -> Import Hosts
You will have to remake images on GUI (unless you play with SQL) but during copy, you can do it.
-
@george1421 I did this again, it said the import was successful…still no images, no hosts, and no ad settings. It looks like import/exporting might not work?
What exactly does the import/export do?
-
@Quazz said:
You need to export the image list. Go to image management, export images, then import them in the VM.
This feature isn’t available in 1.2.0 stable. It’s in FOG Trunk right now (1.3.0 beta).
-
@JDnoble18 said:
@george1421 I did this again, it said the import was successful…still no images, no hosts, and no ad settings. It looks like import/exporting might not work?
What exactly does the import/export do?
The import / export feature exportes the ENTIRE databsae - all settings, everything.
the import overwrites all settings, putting in place everything from the import. -
@jmeyer What do you mean by remaking images on GUI? Doesn’t import/export take care of this? I’ve already got the images copied over from the old server to the new one, do you suggest deleting the images folder and starting over?
-
@Wayne-Workman How stable is 1.3.0? Do you think upgrading my original machine would solve my issues when trying to get this new VM going?
-
@JDnoble18 said:
@jmeyer What do you mean by remaking images on GUI? Doesn’t import/export take care of this? I’ve already got the images copied over from the old server to the new one, do you suggest deleting the images folder and starting over?
OK, just a second here. You did the export using the FOG configuration right. It should have downloaded a config file (fog_backup.sql) right? Of so open that with notepad++ and look at it. You will see database drops and creates, but there should also be insert into lines. This is placing your data back into the new FOG server. The images and snapin files are different but you should be able to copy the database no problem.
… Just thinking. I wonder if you need to restart the fog service so that it sees the updated data? I’m not sure how much fog caches in memory.
-
@george1421 I’ve restarted the server several times switching between the old and the new (same IP) so I don’t think that would be it.
I did open the sql file yesterday and saw things that referred to my old install. I am just confused on what it does export and what it does not.
Right now on my new install, after I import the database, I still get empty boxes in the Fog Configuration > Fog Settings > AD Defaults page.
Is database import/export supposed to copy these settings?
On a different note: Are you suggesting that I just need to record the images page from my old server and mimic these images in the new install? If I do this and the files are there then it should work I assume?
-
This is very, very strange everything should come across except for the physical media. I guess we need to check the apache error log. If you were on rhel it would be /var/log/httpd/error_log. Try the data import and then right away tail the error log and see if the import threw a silent error.
-
Assuming that your original is still up and running, you could try doing a manual database dump and import. This is essentially what the gui is doing so that you don’t have to worry about the command line aspects, but it doesn’t
In the command line on the original server, assuming you went with the default blank password…
mysqldump -u root fog > /home/fog/fog.sql
Then open up winscp, filezilla, cyberduck, or whatever ftp client you prefer (or just use scp in command line to copy straight to the vm) and download the fog.sql file you created.
Then in the new vm server put the fog.sql file in /home/fog and then run this command
mysql -u root fog < /home/fog/fog.sql
And that should take care of it.
Alternatively, especially if it looks like the gui export is working, you can just use the downloaded file from the gui for the second part there.
Hope that helps
-
Thanks for all your help guys! I really appreciate it!
I went ahead and manually entered all my images info.
I copied down all the settings in the fog settings page in preparation to enter it all manually.
I sent one image successfully, just need to make sure hostname changer is working ok.
I will work more on it Monday. Thanks again for all your help!
-
I’m convinced something about the import/export isn’t working right.
It could be SELinux preventing it, could be firewall also.