In our earlier post, we shared how to do online storage migration within the server, from one LUN to another. Today, we are sharing how to do storage migration from one UNIX/LINUX server to other UNIX/LINUX server. In this scenario, LUN’s will be same, but they will be migrated to another server. This is helpful in building new servers.
In the live production environment, sometimes you need to move a filesystem from one server to the other server as a part of new server build, major operating system upgrades etc., so as a system administrator you should know how to do storage migration from one Linux server to another. You can also say, you are doing filesystem migration from one Linux server to another Linux server.
Note: If you don’t do storage migration in a proper way, your Filesystem may get corrupted. Also, we do not provide any guarantee, use our tutorial at your own risk. Though this is fully tested in a live environment.
Steps for Storage Migration from One Linux Server to Another
Steps on Old server:-
Below are the steps which need to be performed on the old server from where you want to migrate your storage LUN’s.
1. First of all you need to un-mount the filesystem which you want to move to another server. Use below command to unmount the filesystem.
# umount <filesystem>
2. Now, make your volume group offline/deactivate.
# vgchange -an <volumegroup>
3. Export your volume group. You will need to export the volume group (VG) under which your LVM is created which is going to be moved.
# vgexport <volumegroup>
4. Now remove the mount point directories of the unmounted filesystem which you are moving to a new server.
# rmdir <DIR_NAME> OR # rm -rf <DIR_NAME>
5. Power off the server.
# shutdown -h now
After completing above steps in old servers, remove the LUN’s visibility from old server and make them available at the new server. If you don’t to this task, ask your storage team to do it for you.
Power-ON the old server and make sure you cannot see the LUN devices for your previous filesystem.
Steps on New server:-
6. On the new server, first of all create the mount point directories and add filesystem entries to /etc/fstab file.
7. Now, you will have to import the volume group which was exported on the old server. Use vgimport command for this. This command makes exported volume groups known to the system.
# vgimport <volumegroup>
8. After, importing your volume group activate the volume group using vgchange command.
# vgchange -ay <volumegroup>
9. Now, mount all the filesystem and verify your filesystem by creating files or changing directory to it.
If you follow the above steps, you will surely able to migrate your filesystem or storage device from one UNIX/LINUX server to another. If you have any problem in any steps, please let us know and we’ll try to help you.
If you like the tutorial don’t forget to share it with others. Do subscribe to our FREE email newsletter to get more tutorial in your mail box.
Before you mount the filesystem on the new server, make sure you have the same owner with same UID and GID created. This may be needed in application servers in some cases.
That is a very good tip Vijayendar. Thanks.
i am traveling to server migration problem when i shift one process based server to another server which contain two process so because it my website which into python not work properly,even it not open my site login also this site contain so much data it .
We are not getting a clear picture. Could you please elaborate?
Also, what error python gives? Are you able to migrate storage properly?