diegogslomp / samba-ad-dc

🐳 Docker image of samba domain controller compiled from source
https://hub.docker.com/r/diegogslomp/samba-ad-dc
GNU General Public License v3.0
48 stars 19 forks source link

Question on updating? #24

Closed farzadha2 closed 5 months ago

farzadha2 commented 5 months ago

Hi @diegogslomp I was wondering was the correct way on updating? Currently using the build of ubuntu, i was running 4.18 and wanted to update, I ram a docker compose rebuild with no cache but the container only logs i see is exited with code 0 thanks

diegogslomp commented 5 months ago

Hi @farzadha2 Check this wiki article. Basically you need to create a backup file with samba-tool domain backup online and restore it with samba-tool domain backup restore. I was thinking in create volumes for only the persistent data instead all the /usr/local/samba but I'm not sure if that's the right way, since none of this is in the official wiki. Any trouble please let me know.

farzadha2 commented 4 months ago

Thanks for the reply, so after many tries not sure if the correct way because cant seem to understand, As the restore is saying to newservername when should be the same server name because i dont want to change the name

if i try the same name i get this error, but if i change to dc3 it works but changing the name of the AD is very traumatic is there another way i missed?


ERROR(ldb): uncaught exception - Entry CN=DC1,OU=Domain Controllers,DC=test,DC=local already exists
  File "/usr/local/samba/local/lib/python3.12/dist-packages/samba/netcmd/__init__.py", line 285, in _run
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/samba/local/lib/python3.12/dist-packages/samba/netcmd/domain/backup.py", line 562, in run
    ctx.join_add_objects(specified_sid=dom_sid(str(sid)))
  File "/usr/local/samba/local/lib/python3.12/dist-packages/samba/join.py", line 637, in join_add_objects
    ctx.samdb.add(rec, controls=controls)
diegogslomp commented 4 months ago

If you want to use the same dc name, I think the best way is to create a temporary dc, join the domain online, once joined demote the first dc and join the newly created server. Check the "Recommended strategy" section in the wiki.

Check the docker-compose for the join commands. Any trouble please let me know.