Hello all,
I consider myself new with this GREAT OS. I used Ubuntu for years. I installed CentOS 7, used it for a long time.
I needed Python 3.6 badly, I decided to copy my /home/ directory to an external disk, now I have CentOS 8 installed.
I would like to copy my old CentOS 7 /home/ directory back to CentOS 8 /home/ directory.
Is there any RISK?
Will I corrupt my new fresh installed CentOS 8 if I do that?
Thanks,
Oscar
HELP!!! CentOS 7 /home/ move it back to CentOS 8 fresh install, any risk?
-
- Posts: 3
- Joined: 2019/08/08 03:08:56
Re: HELP!!! CentOS 7 /home/ move it back to CentOS 8 fresh install, any risk?
You should be able to copy your home directory over without issue. Just run chown to change the ownership to the user account on the new server/workstation. You'd want to do this for every user that was on the old install. And it probably wouldn't hurt to relabel all of those files as user_home_dir_t.
Code: Select all
chown -R <your_newuseraccount> /home/<your_newuseracount>/
restorecon -R /home
Re: HELP!!! CentOS 7 /home/ move it back to CentOS 8 fresh install, any risk?
1. Python 3.6 is available on base CentOS 7.7. (package names: python3-*)
Before 7.7 there were/are rh-python36-* in SCL repo and python36-* in EPEL repo.
2. You have /external/home/oscar and want to copy it to /home/oscar
There are multiple scenarios:
2A You already have /home/oscar
* A trivial copy could/would overwrite the new files created by CentOS 8, like ~/.bashrc. On the other hand the version from 7 might have your customizations. Question is: should you merge configs or just stick to 7's versions? (I did "overwrite" but am checking what the new would offer.)
* What if uid/gid of old oscar were different from new oscar? Depending on how you copy, you might have to 'chown'.
2B There is no /home/oscar
* Copy is trivial; nothing is overwritten. No risks in that.
* If uid/gid of oscar7 are identical to newname8, then you have two directories in /home/ that are both owned by newname8. You want to merge somehow.
* If new system does not have uid/gid that oscar in 7 did use, then you could 'useradd' with specific uid/gid and "do not create homedir". Or chown&merge.
Before 7.7 there were/are rh-python36-* in SCL repo and python36-* in EPEL repo.
2. You have /external/home/oscar and want to copy it to /home/oscar
There are multiple scenarios:
2A You already have /home/oscar
* A trivial copy could/would overwrite the new files created by CentOS 8, like ~/.bashrc. On the other hand the version from 7 might have your customizations. Question is: should you merge configs or just stick to 7's versions? (I did "overwrite" but am checking what the new would offer.)
* What if uid/gid of old oscar were different from new oscar? Depending on how you copy, you might have to 'chown'.
2B There is no /home/oscar
* Copy is trivial; nothing is overwritten. No risks in that.
* If uid/gid of oscar7 are identical to newname8, then you have two directories in /home/ that are both owned by newname8. You want to merge somehow.
* If new system does not have uid/gid that oscar in 7 did use, then you could 'useradd' with specific uid/gid and "do not create homedir". Or chown&merge.
- KernelOops
- Posts: 428
- Joined: 2013/12/18 15:04:03
- Location: xfs file system
Re: HELP!!! CentOS 7 /home/ move it back to CentOS 8 fresh install, any risk?
this is a typical scenario and many people just move their home directories from the old to the new installation. Unless you have some weird stuff going on, it should work without problems. It should even work when moving from different distros, like centos to fedora etc.
my first action, is to re-create the user in the new installation to match the one I was using (uid/gid match) and then just copy the home directories to /home, and finally run restorecon to make sure SELinux permissions are correct.
my first action, is to re-create the user in the new installation to match the one I was using (uid/gid match) and then just copy the home directories to /home, and finally run restorecon to make sure SELinux permissions are correct.
--
R.I.P. CentOS
--
R.I.P. CentOS
--