Difference between revisions of "Migrate images manually"

From FOG Project
Jump to: navigation, search
(using NFS)
Line 8: Line 8:
  
 
<pre>lftp -c 'open x.x.x.x; user UserGoesHere PasswordHere; mirror -e /images/TheImagePath /images/TheImagePath; quit'</pre>
 
<pre>lftp -c 'open x.x.x.x; user UserGoesHere PasswordHere; mirror -e /images/TheImagePath /images/TheImagePath; quit'</pre>
 +
 +
Example:
 +
 +
<pre>
 +
mkdir /images
 +
lftp -c 'open 10.0.0.4; user fog MyAwesomePassword; mirror -e /images /images; quit'
 +
</pre>
 +
  
 
== using NFS ==
 
== using NFS ==
 
'''Copying one image example:'''
 
  
 
<pre>
 
<pre>
mount x.x.x.x:/<remote directory> <local directory>
+
mkdir /images
cp -R /mbimages/Optiplex9020UEFI /images/Optiplex9020UEFI
+
mount x.x.x.x:/<remote source> <local mount point>
umount <local directory>
+
cp -R /<local mount point>/* /<local destination>
 +
umount <local mount point>
 
</pre>
 
</pre>
  
'''Copying all images to a new server before installing fog:'''
+
Example:
 
 
These steps are done on the fresh new server.
 
  
 
<pre>
 
<pre>
cd /
 
 
mkdir /images
 
mkdir /images
mkdir tempMount
+
mkdir /tempMount
mount x.x.x.x:/images /tempMount    #--Where x.x.x.x is the old fog server's address.
+
mount 10.0.0.4:/images /tempMount
cd /tempMount
+
cp -R /tempMount/* /images
cp -R * /images
 
 
umount /tempMount
 
umount /tempMount
 
</pre>
 
</pre>
  
 
== Using Samba ==
 
== Using Samba ==
 +
 +
<pre>
 +
mkdir /LocalMountPointHere
 +
mount -t cifs //x.x.x.x/ShareNameGoesHere /LocalMountPointHere -o username=YourUsernameGoesHere -o password=YourPasswordGoesHere,noexec
 +
cp -r /LocalMountPointHere/* /DestinationHere
 +
umount /LocalMountPointHere
 +
</pre>
 +
 +
Example:
  
 
<pre>
 
<pre>
 
mkdir /tempMount
 
mkdir /tempMount
mount -t cifs //x.x.x.x/ShareNameGoesHere /tempMount -o username=YourUsernameGoesHere -o password=YourPasswordGoesHere,noexec
+
mkdir /images
cp -r /tempMount/ImageNameHere /images/ImageNameHere
+
mount -t cifs //10.0.0.4/images /tempMount -o username=root -o password=MyAwesomePassword,noexec
 +
cp -r /tempMount/* /images
 
umount /tempMount
 
umount /tempMount
 
</pre>
 
</pre>
Line 44: Line 57:
 
== Using SCP ==
 
== Using SCP ==
  
<pre>scp -r /images/ImageNameHere root@x.x.x.x:/images/ImageNameHere</pre>
+
<pre>scp -r root@x.x.x.x:/images/* /images</pre>
 +
 
 +
Example:
 +
 
 +
<pre>
 +
mkdir /images
 +
scp -r root@10.0.0.4:/images/* /images
 +
</pre>
 +
 
  
 
== Using rsync ==
 
== Using rsync ==
  
 
<pre>
 
<pre>
rsync -a /images/ImageNameHere root@x.x.x.x:/images/ImageNameHere
+
rsync -a root@x.x.x.x:/images/* /images
 
</pre>
 
</pre>
 +
 +
Example:
 +
 +
<pre>
 +
mkdir /images
 +
rsync -a root@10.0.0.4:/images* /images
 +
</pre>
 +
  
 
= Image Definitions =
 
= Image Definitions =

Revision as of 15:27, 12 October 2016

This describes how to manually migrate an image or all images to another server.

Image files

Below, are many options for migrating an individual image. If you wanted to migrate all images, just change the source/destination paths in the below commands to /images Also, where you see x.x.x.x, this is the old storage node's IP address. These commands are written to be run on the new storage node.

using lftp

lftp -c 'open x.x.x.x; user UserGoesHere PasswordHere; mirror -e /images/TheImagePath /images/TheImagePath; quit'

Example:

mkdir /images
lftp -c 'open 10.0.0.4; user fog MyAwesomePassword; mirror -e /images /images; quit'


using NFS

mkdir /images
mount x.x.x.x:/<remote source> <local mount point>
cp -R /<local mount point>/* /<local destination>
umount <local mount point>

Example:

mkdir /images
mkdir /tempMount
mount 10.0.0.4:/images /tempMount
cp -R /tempMount/* /images
umount /tempMount

Using Samba

mkdir /LocalMountPointHere
mount -t cifs //x.x.x.x/ShareNameGoesHere /LocalMountPointHere -o username=YourUsernameGoesHere -o password=YourPasswordGoesHere,noexec
cp -r /LocalMountPointHere/* /DestinationHere
umount /LocalMountPointHere

Example:

mkdir /tempMount
mkdir /images
mount -t cifs //10.0.0.4/images /tempMount -o username=root -o password=MyAwesomePassword,noexec
cp -r /tempMount/* /images
umount /tempMount

Using SCP

scp -r root@x.x.x.x:/images/* /images

Example:

mkdir /images
scp -r root@10.0.0.4:/images/* /images


Using rsync

rsync -a root@x.x.x.x:/images/* /images

Example:

mkdir /images
rsync -a root@10.0.0.4:/images* /images


Image Definitions

Image definitions are what's stored in the database, and what is displayed in the web interface. There are DB entries for each image. Image definitions do not automatically appear just because the image files are present on the storage node, this is a common misconception.

You may recreate these manually, but you must recreate them exactly as they were on the old server. The image path must be exact and is case sensitive, the image OS and image type must be set exactly as in the old server as well.

The easiest option is to use FOG's export/import feature inside of Image Management.