[CentOS] Data migration from one server to another- Centos 7

2019-08-12 Thread Matt Zand
I want to move all my OS, services like Apache configuration and
application (web server) files and folders to another brand new server.
Both servers are running on Centos 7. i want to  clone everything.

My questions
1- what is the easiest way to do this?
2- do I need to partition hard-drive of new server exactly as old one?
3- Is there any changes to make on new server after full migration?
4- will root and other user credentials stay the same?

Any other suggestion appreciated,

-- 
Cheers,

Matt Zand
Cell: 202-420-9192
Work: 240-200-6131
High School Technology Services 
DC Web Makers 
Coding Bootcamps 
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Data migration from one server to another- Centos 7

2019-08-12 Thread mark
Matt Zand wrote:
> I want to move all my OS, services like Apache configuration and
> application (web server) files and folders to another brand new server.
> Both servers are running on Centos 7. i want to  clone everything.
>
>
> My questions
> 1- what is the easiest way to do this?
> 2- do I need to partition hard-drive of new server exactly as old one?
> 3- Is there any changes to make on new server after full migration?
> 4- will root and other user credentials stay the same?
>
>
> Any other suggestion appreciated,
>

>From our documentation wiki at work:

 Log in to the host that needs upgrading or reloading.

Create directories to hold the new file system:

mkdir /new
mkdir /boot/new


Rsync the files from the machine you are copying

rsync -HPavzx --exclude=/old --exclude=/var/log/wtmp
--exclude=/var/log/lastlog $machine:/. /new/.
rsync -HPavzx $machine:/boot/. /boot/new/.


After the copy, check these files:

/boot/new/grub/device.map - should list the correct device name for hd0
/new/etc/fstab - should have the correct labels for file systems
/new/etc/sysconfig/network - edit to list the correct hostname (or
localhost.localdomain if DHCP enabled)
/new/etc/sysconfig/network-scripts/ifcfg-ethX - remove or edit the
line with "HWADDR"
/new/etc/modprobe.conf - edit or copy from the original file to
include all devices p
/new/etc/exports - add or remove exported file systems
diff -u /boot/grub/device.map /boot/new/grub/device.map
diff -u /etc/fstab /new/etc/fstab
diff -u /etc/sysconfig/network /new/etc/sysconfig/network
diff -u /etc/modprobe.conf /new/etc/modprobe.conf
diff -u /etc/exports /new/etc/exports

To prevent problems with kudzu and the Ethernet interfaces:

rsync -HPavzx /etc/sysconfig/network-scripts/ifcfg-eth*
/new/etc/sysconfig/network-scripts
rsync -HPavzx /etc/sysconfig/hwconf /new/etc/sysconfig
rsync -HPavzx /boot/grub/device.map /boot/new/grub/
rsync -HPavzx /etc/udev/rules.d/70-persistent-net.rules
/new/etc/udev/rules.d/

The last, above, is extremely important starting with CentOS 6. Without
that, you might find that eth0 is, in fact, eth4 or some such.

Also, on the new machine, run

 find /new/var/log/ -type f -exec cp /dev/null {} \;

This will truncate all the copies logfiles from the source of the clone,
but leave directories, etc, existing, and with the correct permissions.

Add a single user kernel option to grub.conf file. Grub doesn't always
allow you to edit the startup options because of a mismatched grub
versions.
Verify the Grub root and kernel lines reference the correct hard drive
partitions.

Finally, apply labels to the filesystem:

 e2label /dev/sda1 /boot
 e2label /dev/sda3 /
 swapoff -av
 mkswap -L SWAP-sda2 /dev/sda2
 swapon -av

then verify that the labels match /new/etc/fstab. After doing this, edit
/boot/grub/grub.conf, and make sure that the root= parameter on the kernel
line matches the label (root=LABEL=/), not some randomly-generated UUID.
Additional things to copy

Check to see what services are running currently.

If a webserver was running on the old server,

 rsync -HPavzx /old/etc/httpd/conf.d/* /etc/httpd/conf.d/

If siteminder was running,

 rsync -HPavzx /old/etc/httpd/conf/* /etc/httpd/conf/
 rsync -HPavzx /old/usr/local/opt /usr/local/

And either

 rsync -HPavzx /old/public /

or

 rsync -HPavzx /old/var/www/html/* /var/www/html/

If this is an h/a cluster, make sure heartbeat is installed, and

 rsync -HPavzx /old/etc/ha.d/* /etc/ha.d/

If this is a compute cluster node, go to the cluster head node and follow
the instructions for configuration at PBS/torque for adding a new node.

If this system is using Linux RAID,

 rsync -HPavx /old/etc/md.conf /etc/

Also make sure that /etc/fstab is correct.

NOTE: it appears that the ramdisk contains information about RAID. It
might be better to install a minimal system, upgrade it in place, then
rsync /, but not /boot.
SSH keys - Important

Copy the original SSH keys:

rsync -HPavzx /etc/ssh/ssh_host* /new/etc/ssh

Rotation

Move things live, after running: zmodload zsh/files

Swap the old and new directory structures around on both / and /boot.

zsh
zmodload zsh/files

cd /boot
mkdir old
mv * old
mv old/lost+found .
mv old/new/* .

# Root partition.
cd /
mkdir old
mv * old
mv old/lost+found .
#mv old/root . -- WHY?
mv old/scratch .
mv old/new/* .

sync
sync

Make selinux reset all the security file labels

touch /.autorelabel

Create a single user option in /etc/grub.conf file if this isnt a
routine upgrade.
Reboot to the upgraded OS (init 6).
You may need to do the 'use the old kernel' trick including copying
over the kernel and modules, removing the new kernel and putting it
back.

/boot   - kernel files
/lib/modules - kernel modules

Ooops! I forgot to run zmodload zsh/files

If you fail to run zmodload zsh/files, whilst doing an rsync upgrade, you
can do the following

   MODULE_PATH=/old/usr/lib64/zsh/4.3.4
   

Re: [CentOS] failure to install LibreOffice 6.3.0.4

2019-08-12 Thread Jerry Geis
Hi Fred,

I do this from time to time...  download the tgz...
then I extract the tgz, cd RPMS then run
rpm -i  *.rpm --force

Then of course you man need to change your path to use the new /op/

Hope that helps,

Jerry
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] failure to install LibreOffice 6.3.0.4

2019-08-12 Thread Fred Smith
On Mon, Aug 12, 2019 at 01:31:49PM -0400, Jerry Geis wrote:
> Hi Fred,
> 
> I do this from time to time...  download the tgz...
> then I extract the tgz, cd RPMS then run
> rpm -i  *.rpm --force
> 
> Then of course you man need to change your path to use the new /op/
> 
> Hope that helps,
> 
> Jerry

In fact, Jerry, I finally got it installed with:

rpm -ivh *.rpm

(after extracting all the files from the LOo tarball).

didn't need the --force.

It just seems really weird that yum reacts the way it does.

-- 
---
 .Fred Smith   /  
( /__  ,__.   __   __ /  __   : / 
 //  /   /__) /  /  /__) .+'   Home: fre...@fcshome.stoneham.ma.us 
//  (__ (___ (__(_ (___ / :__ 781-438-5471 
 Jude 1:24,25 -
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] another bizarre thing...

2019-08-12 Thread Jobst Schmalenbach
On Sun, Aug 11, 2019 at 08:52:59PM -0400, Fred Smith 
(fre...@fcshome.stoneham.ma.us) wrote:
> On Mon, Aug 12, 2019 at 10:16:35AM +1000, Jobst Schmalenbach wrote:
> > On Mon, Aug 05, 2019 at 08:57:45PM -0400, Fred Smith 
> > (fre...@fcshome.stoneham.ma.us) wrote:
> > > Hi all!
> > 
> > Late to the thread but since it has not been suggested: Have you tried to 
> > statically link all libs?
> 
> I doubt modern Linux systems will produce a fully-static binary, since
> many of the system libs come only as .so files. 

I know that.
It's just how keen you are to find the reason ... especially if you have no 
control what libraries (even i686) are installed on the other machines.

Depening how many libraries the binary uses you could download them and use 
those as source for inclusion.
You could omit the obvious libs for starters ... and then even include those if 
still crashing.
You only need to distribute those binaries to the people who have problems ...

If a couple of those customers (failing progs) are helpful get a "yum list 
installed" and scan the list of libs and see whether sth might raise eyebrows.


For example I had one of my machines failing on one prog because it had 
"glibc.i686" installed due to ftdi.
I changed the program using the ftdi libs to use full x86_64 (took me a few 
hours) and unstinalled the "glibc.i686" and suddenly the other prog had no 
problems!

I know you cant tell people to un-install but static linking MIGHT help.





-- 
Jobst Schmalenbach
Who is general Failure and what is he doing on my disk?

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos