有些国产Linux系统存在迁移困难的问题,无法直接制作镜像等问题。
此时需要将待迁移的机器如下目录进行打包压缩(如果有其他位置存储了关键程序也需要一并打包)
tar -cvpf /home/toec/all_s/opt.tar /opt
tar -cvpf /home/toec/all_s/usr.tar /usr
tar -cvpf /home/toec/all_s/etc.tar /etc
tar -cvpf /home/toec/all_s/var.tar /var
然后将压缩包移植到新机器中,放到 /home目录或 /tmp目录进行解压 如:tar -xf opt.tar
最后对解压的文件执行如下命令即可安全的实现迁移。
cp --update -rn usr/* /usr
cp --update -rn opt/* /opt
cp --update -rn etc/* /etc
cp --update -rn var/* /var
觉得有用的兄弟可以一键三连支持一下哦