ROOT DIRECTORY MIGRATION

Latest response

I have a syslog server running on an OLD debian VM server on 10.0.3.254, I want to migrate the entire root directories to Redhat VM on 10.0.2.245 /var. Is this something possible? If yes, could i please get some suggestion on what command i need to make this happen?

Responses

Hi Samuel,

If I understand it correctly, you want to move the complete root directory from the debian server to the /var directory of the
RHEL server. This most certainly would generate a lot of trouble, because the debian root directory content differs from the
RHEL root directory content and especially from the RHEL /var directory content. It's better to set up a new RHEL server. :)

Regards, Christian

Samuel,

As Christian said, please highly consider building a new server, and if you wish to make the old server's data available, rsync the applicable data to a separate drive that is not "/var" - the "/var" directory's purpose is cited at this link

2.1.1.11. The /var/ Directory
Since the FHS requires Linux to mount /usr/ as read-only, any programs that write log files or need spool/ or lock/ directories should write them to the /var/ directory. The FHS states /var/ is for variable data, which includes spool directories and files, logging data, transient and temporary files. 

System log files, such as messages and lastlog, go in the /var/log/ directory. The /var/lib/rpm/ directory contains RPM system databases. Lock files go in the /var/lock/ directory, usually in directories for the program using the file. The /var/spool/ directory has subdirectories that store data files for some programs. These subdirectories include:  (SEE LINK ABOVE)

The text block above has some info on the purpose of /var - I'd recommend if you do end up mounting the data from your previous server, to consider only mounting portions of it, omitting things like /etc/passwd /etc/shadow and /root (from your previous system) among other sensitive areas you'd normally not expose. Please carefully consider the permissions so you protect your important data, or sensitive information for your business etc.

That link I provided has a description of the major file systems in a modern Linux system. While it mentions RHEL 7, it is still relevant for RHEL 8.

Kind Regards,
RJ