How to migrate Samba User Accounts to a new linux server?

I have an Ubuntu 6.06 server that needs to be replaced by an Ubuntu 9.04 server clean setup, I already copied the entire samba file server directory to the new 9.04 server using rsync. I need to know how to migrate the existing user accounts (machine accounts) to the new server so as when I physically transfer the connections everything will be ok and I don't have to manually enter smbpasswd -a <user> on the new server.

passdb backend = tdbsam

network workstations accessing the share are either vista or xp.


Solution 1:

passdb backend = tdbsam

means you have your samba accounts in a passdb.tdb file in SAMBA_DIR/private.

As long as you copy it with rsync you are fine.

There are two caveats:

  • Unix users: a samba user has to be a unix user as well, so you have to copy all files @churnd told you;
  • timing: machine account are updated every time, so you need a super fresh rsync. In a perfect world, you should stop old server, rsync, start new server.