How to change admin email address?

Hello,

Our admin suddenly left and we realized we cannot change the email address of the Admin account. How do we change their email address without losing data? It’s very important to us since we have a lot of info stored here.

We’re on professional with less than 10 users.

Also, using docker in case that matters.

Hi,

You can probably achieve this by editing the right table in the db, but creating a new admin account looks like an easier way:

docker exec -it seafile /opt/seafile/seafile-server-latest/reset-admin.sh

https://manual.seafile.com/docker/pro-edition/Deploy%20Seafile-pro%20with%20Docker/#add-a-new-admin

1 Like

Hi Barolo, what effect does this have on the files owned by the admin?

This has no effect since the script creates a new account. Then, you can transfer the libraries and delete the old account from the admin panel.

1 Like

Thank you so much. One final related question: we have one massive 750GB library owned by the admin. Is transferring that to another account via the interface an issue?

I honestly don’t know. My guess is it won’t be an issue since it just changes the owner, but I can’t assure that.

1 Like

Do you know if it’s possible to change the admin credentials in the database instead? Would that work, you think?

From what I looked at from the database, it doesn’t look good. The email is set in many tables which all have to be updated. I found this list on github but it could be outdated:

This is still something you can check on a test instance.

Thank you. I went through the code and to the best of my knowledge it looks like changing the repo owner is a simple database update so it shouldn’t matter how big the repo is.
Can’t post links: [github]/haiwen/seafile-server/blob/1288c1ec103f5dbb6158d2fc15dedffc5b03d912/server/repo-mgr.c#L2070

We only have 9 user licenses and use all 9. If I attempt to create another with the reset-admin.sh method, will this cause issues?

No idea, I use the community version. What I would do in your position is bypassing the limitation by transferring the libraries to another user, removing the old admin account, creating the new one and transferring the data back. This has obvious confidentiality issues you may not want to deal with and could be really tedious for a large number of libraries.

In any case I don’t know more at this point. Good luck with your problem, it’s quite disturbing there isn’t an easier way to update an email address. :confused:

Hello,you can create a new admin account by seahub, then this account can list all the repos on the server, and you can transfer the original admin’s repos to others.You can run the reset-admin.sh to create the new admin’s account.

Good news, the latest Seafile version (8.0.4) now allows to change a user’s email.

Tested a little curl request and it works just fine:

curl http://domain.tld/api/v2.1/admin/update-user-ccnet-email/ -X PUT -H 'X-CSRFToken: <TOKEN>' -H 'Cookie: sfcsrftoken=<TOKEN>; sessionid=<ID>' -F "old_email=old@email.me" -F "new_email=new@email.me"