Allow editing of Site in device bulk edit #4522

Closed
opened 2025-12-29 18:36:57 +01:00 by adam · 3 comments
Owner

Originally created by @rodvand on GitHub (Feb 2, 2021).

Originally assigned to: @rodvand on GitHub.

Environment

  • Python version: 3.6.8
  • NetBox version: 2.10.4

Proposed Functionality

When bulk editing devices, allow changing sites. So, go to Devices -> Search for your desired term -> Select devices wanting to edit -> Edit Selected -> Here Site would be added as an editable field.

Use Case

  • Moving multiple devices between sites
  • Creating a more granular structure where smaller sites are created and devices need to be moved into these smaller sites

Database Changes

None.

External Dependencies

None.

The only thing I can see as a challenge here is when a device is racked. It would mean you would either have to not allow changing the site when devices are racked, or move it out from the rack and set the rack space as empty and available.

Originally created by @rodvand on GitHub (Feb 2, 2021). Originally assigned to: @rodvand on GitHub. ### Environment * Python version: 3.6.8 * NetBox version: 2.10.4 ### Proposed Functionality When bulk editing devices, allow changing sites. So, go to Devices -> Search for your desired term -> Select devices wanting to edit -> Edit Selected -> Here Site would be added as an editable field. ### Use Case - Moving multiple devices between sites - Creating a more granular structure where smaller sites are created and devices need to be moved into these smaller sites ### Database Changes None. ### External Dependencies None. The only thing I can see as a challenge here is when a device is racked. It would mean you would either have to not allow changing the site when devices are racked, or move it out from the rack and set the rack space as empty and available.
adam added the status: acceptedtype: feature labels 2025-12-29 18:36:57 +01:00
adam closed this issue 2025-12-29 18:36:57 +01:00
Author
Owner

@rodvand commented on GitHub (Mar 1, 2021):

I added the following to the DeviceBulkEditForm in netbox/dcim/forms.py just to test:

    site = DynamicModelChoiceField(
        queryset=Site.objects.all(),
        required=False
    )

This seems to do the trick as it allows me to move devices from one site to another in bulk. It also fails on validation if trying to move a racked device, a behaviour I feel is sensible and predictable. Any objections to "accepting" this feature?

@rodvand commented on GitHub (Mar 1, 2021): I added the following to the DeviceBulkEditForm in `netbox/dcim/forms.py` just to test: ``` site = DynamicModelChoiceField( queryset=Site.objects.all(), required=False ) ``` This seems to do the trick as it allows me to move devices from one site to another in bulk. It also fails on validation if trying to move a racked device, a behaviour I feel is sensible and predictable. Any objections to "accepting" this feature?
Author
Owner

@dreng commented on GitHub (Mar 11, 2021):

I really missed this feature this week when I had to change approx. 40 devices, editing one by one. I just want to add that not only sites should be added but at least also rack groups and racks.

@dreng commented on GitHub (Mar 11, 2021): I really missed this feature this week when I had to change approx. 40 devices, editing one by one. I just want to add that not only sites should be added but at least also rack groups and racks.
Author
Owner

@rodvand commented on GitHub (Mar 11, 2021):

@dreng You should create a separate FR for editing rack groups and racks to keep this to the one feature requested.

@rodvand commented on GitHub (Mar 11, 2021): @dreng You should create a separate FR for editing rack groups and racks to keep this to the one feature requested.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4522