Netbox tenant to tenant migration #12088
-
As we got a new company in the group, we would like to migrate their Netbox tenant database to our current Netbox. Bot run version 3.4.4. I've tried exporting Is there a way to do a tenant-to-tenant migration without exporting/importing manually every section and dealing with many issues? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
It sounds like you're asking "can I export a subset of data from one Netbox and import it into another"? I'm afraid this is very difficult, as you've already found, and is not really a supported use case. If the target is a fresh Netbox, your simplest approach may be to clone the whole database, then delete everything else that's not needed in the target instance. I have done migrations via SQL-level export and import in the past (SELECT and INSERT), but if you're importing into a Netbox instance which has existing data, you would have to modify the exported data to replace any primary keys which clashed with existing values - and find and change all the references to those primary keys - prior to importing. You'd also have to update the sequences to skip past the new values assigned. The other options are also very difficult to do a high-fidelity export and import:
|
Beta Was this translation helpful? Give feedback.
-
Yes, you can easily script this out using the pynetbox API client. The docs list a recommended order of operations for populating new data. However, the much bigger challenge is in validating the data prior to replication: identifying duplicate or invalid objects, ensuring consistency with existing conventions (tagging, etc.), determining which custom fields need to be replicated, and so forth. Make sure you have a written plan in plan to address these questions before beginning, or you'll end up making more work for yourself. |
Beta Was this translation helpful? Give feedback.
-
In the end, I did this by exporting the other Netbox data's csv files, modifying them and importing them to my Netbox installation. It was a tedious and long process especially because I didn't know how to modify the header and some data but in the end, I could do it. It would be great if there was a migration tool for operations like that. |
Beta Was this translation helpful? Give feedback.
In the end, I did this by exporting the other Netbox data's csv files, modifying them and importing them to my Netbox installation. It was a tedious and long process especially because I didn't know how to modify the header and some data but in the end, I could do it.
It would be great if there was a migration tool for operations like that.