Skip to content

Is it possible to merge two Netbox instances? #17134

Answered by candlerb
pettcomputers asked this question in Q&A
Discussion options

You must be logged in to vote

It is hard.

Let's say the postgres sequences on both systems are currently less than 10,000. You could update all the sequences on one system to 20,000 and continue using it. Then on the other system, renumber all the object IDs into the range 10,000-19,999, pg_dump and import into the first.

The painful part though is the renumbering, because you'll have to identify and fix all foreign keys; and that doesn't mean just obvious foreign keys between tables, but the generic foreign key references too.

Rather than renumber in-situ, I'd suggest that you pg_dump the data as-is, then write scripts to perform the renumbering of the SQL data offline (e.g. inside a temporary database with FK constr…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pettcomputers
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants