Question: 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.

Answer: 
```
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.
You'll need to copy /etc/passwd, /etc/shadow, /etc/group, /etc/samba/smbusers, and /etc/samba/smbpasswd. [This site](http://www.cyberciti.biz/faq/howto-move-migrate-user-accounts-old-to-new-server/) shows you how to do the first 3, but I've done the last two and it worked fine.