Best option then would be to store the mapping in some form (such as a
Python dictionary or JSON file) and then have a script go through and
update each via the mapping. This could be done as part of the script
above. It should be a matter of taking the username, looking up the new one
from the map, and assigning the result back out to the user before saving.

We help with migrations and other situations like this under a Premium
Support contract, if you're interested in discussing one for your server.

Christian

On Mon, Aug 13, 2018 at 10:30 AM Mojgan Samifanni <
mojgan.samifa...@gmail.com> wrote:

> There are over 400 users and I need to automate the renaming of the users
> id.
>
> On Sat, Aug 11, 2018 at 8:29 PM, Christian Hammond <
> christ...@beanbaginc.com> wrote:
>
>> Hi,
>>
>> You can change the username of each of the users in the database to match
>> their usernames in LDAP. You'll then need to set each to use an "unusable"
>> password, which unfortunately cannot be done through the administration UI.
>> You can do this through the management shell by doing:
>>
>> $ rb-site manage /path/to/sitedir shell
>> from django.contrib.auth.models import User
>>
>> for user in User.objects.filter(is_superuser=False):
>>     user.set_unusable_password()
>>     user.save()
>>
>>
>> That will disable the in-database hashed password for each non-admin user
>> (you always want at least your primary admin user to have an in-database
>> password, in case LDAP goes down or there's a configuration issue).
>>
>> How many users do you have in the database? There are ways to automate
>> the renaming of the users if needed.
>>
>> Christian
>>
>> On Thu, Aug 9, 2018 at 7:27 PM <mojgan.samifa...@gmail.com> wrote:
>>
>>> We are currently using standard authentication but I have set up new
>>> server to use LDAP authentication. Is there a way that I can map the
>>> Standard ID to LDAP id after I move the database content to new server
>>>
>>> --
>>> Supercharge your Review Board with Power Pack:
>>> https://www.reviewboard.org/powerpack/
>>> Want us to host Review Board for you? Check out RBCommons:
>>> https://rbcommons.com/
>>> Happy user? Let us know! https://www.reviewboard.org/users/
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Review Board Community" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to reviewboard+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Christian Hammond
>> President/CEO of Beanbag <https://www.beanbaginc.com/>
>> Makers of Review Board <https://www.reviewboard.org/>
>>
>> --
>> Supercharge your Review Board with Power Pack:
>> https://www.reviewboard.org/powerpack/
>> Want us to host Review Board for you? Check out RBCommons:
>> https://rbcommons.com/
>> Happy user? Let us know! https://www.reviewboard.org/users/
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Review Board Community" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to reviewboard+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> Supercharge your Review Board with Power Pack:
> https://www.reviewboard.org/powerpack/
> Want us to host Review Board for you? Check out RBCommons:
> https://rbcommons.com/
> Happy user? Let us know! https://www.reviewboard.org/users/
> ---
> You received this message because you are subscribed to the Google Groups
> "Review Board Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reviewboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Christian Hammond
President/CEO of Beanbag <https://www.beanbaginc.com/>
Makers of Review Board <https://www.reviewboard.org/>

-- 
Supercharge your Review Board with Power Pack: 
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: 
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to