• some_guy@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    This method can also be used migrating a user account to a different machine. I needed to swap three users in an office and used scp to copy the home directories between devices. Then, when creating the new user accounts the OS will offer to adopt them. Else, create the accounts before copying and then rename and replace them when copying.

    No one had any indication that the copy was in progress, as everything was on a wired local network. I created the accounts in the morning before anyone came to the office and it all worked automagically. Just be sure to update permissions as needed.

    • mingistech@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Yes, I use a similar method but with rsync opposed to scp. rsync retains permissions so no need to chown the home directory afterwards. Also since rsync is truly a sync and not a copy if users need to use an old system a bit more when you run it again it quickly moves over only what has changed since last time the command was ran.

      • some_guy@lemmy.sdf.org
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        As I was reading your comment another bonus popped into my head. rsync would be better for resuming an interrupted transfer as opposed to starting over.

        • mingistech@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          Yes, it’s great when you need to stop and resume. For data migrations between Macs I typically use…

          caffeinate sudo rsync -vaEP

          The flags are:

          • v increases verbosity.
          • a applies archive settings to mirror the source files exactly, including symbolic links and permissions.
          • E copies extended attributes and resource forks (macOS only).
          • P progress provides a count down and transfer statistics during the copy.