Complete Migration? #14104
Replies: 13 comments 20 replies
-
Dump the database from postgresql on the old instance (referencing the postgresql documentation for specifics), copying any shared/uploaded files and restoring those on the new server, running upgrade.sh if this also changes the version of netbox installed.
once you have a good backup, you can run through the restore process as many times as you need to work out any kinks and make sure you understand the process, without losing data.
I would also be advised when testing a new instance that if you are using webhooks to signal external systems, or scripts/cronjobs that make changes that you are only allowing one of those to run at a time, so you aren't creating duplicate/conflicting changes in prod from your in-setup system.
—
Mark Tinberg ***@***.***>
Division of Information Technology-Network Services
University of Wisconsin-Madison
…________________________________
From: deanfourie1 ***@***.***>
Sent: Monday, October 23, 2023 5:11 AM
To: netbox-community/netbox ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [netbox-community/netbox] Complete Migration? (Discussion #14104)
I would like to migrate all data from a previous Netbox instance to a new one?
What's the best way to do this?
Thanks
—
Reply to this email directly, view it on GitHub<#14104>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAS7UM243WBE46DEATK3MKTYAY7ELAVCNFSM6AAAAAA6L2AUHKVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZVG43DMOBSGU>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
FYI, more details of the migration. I want to go from version 3.6.1 to version 3.6.4. Is this as simple as a DB export and import? No version stepping required in between? The 3.6.1 installation is with docker-compose. I cannot seem to export the db using
Using password netbox, I receive the following error.
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I'm having some issues with the import. Heres the error.
|
Beta Was this translation helpful? Give feedback.
-
Anyone, would hate to have to do everything again from scratch. Thanks |
Beta Was this translation helpful? Give feedback.
-
Everytime I attempted to import the database with
I can see that template1 gets deleted with a \l in psql, there is no template1, before running the import, template 1 is there. This is now beginning to get very frustrating. |
Beta Was this translation helpful? Give feedback.
-
Guess im on my own with this one. |
Beta Was this translation helpful? Give feedback.
-
I would remove that from the dump, the dump should just be of the netbox database, not postgresql defaults which may be different between releases or distro builds (I don't know enough about postgresql administration to have a sense of how likely that is), the netbox application database shouldn't have anything version/install specific in it as it supports a wide range of versions from pg12 to current I think.
And yeah, the dump from pg (and mysql) is just the text of the SQL commands so you can edit it with sed or whatever is your favorite editor to make changes before import. Using the SQL text which is a stable language is highly portable.
—
Mark Tinberg ***@***.***>
Division of Information Technology-Network Services
University of Wisconsin-Madison
…________________________________
From: deanfourie1 ***@***.***>
Sent: Friday, October 27, 2023 5:16 PM
To: netbox-community/netbox ***@***.***>
Cc: Mark Tinberg ***@***.***>; Comment ***@***.***>
Subject: Re: [netbox-community/netbox] Complete Migration? (Discussion #14104)
Ok thanks, I hadn't even thought of doing this. Inside the SQL file I found the following.
CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE_PROVIDER = libc LOCALE = 'en_US.utf8';
This is the point at which it fails, so I can now narrow down the issue to be directly related to the above database format that seems to be incorrect. Further more, seems to be failing with
LOCALE_PROVIDER = libc
Any ideas?
—
Reply to this email directly, view it on GitHub<#14104 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAS7UM2YE3G3LV62ZQDJXNDYBQXEBAVCNFSM6AAAAAA6L2AUHKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TIMBXHEZTE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I gave up on this. Please implement a more satisfactory import/export option. I think it's beneficial. |
Beta Was this translation helpful? Give feedback.
-
I'm sorry to hear that. I know this doesn't solve your immediate problem, but maybe a hosted service where someone else can make it their full time job to worry about the server software/db install/upgrade/backup/maintenance makes more sense for your site.
—
Mark Tinberg ***@***.***>
Division of Information Technology-Network Services
University of Wisconsin-Madison
…________________________________
From: deanfourie1 ***@***.***>
Sent: Monday, October 30, 2023 3:21 PM
To: netbox-community/netbox ***@***.***>
Cc: Mark Tinberg ***@***.***>; Comment ***@***.***>
Subject: Re: [netbox-community/netbox] Complete Migration? (Discussion #14104)
I gave up on this.
Please implement a more satisfactory import/export option.
I think it's beneficial.
—
Reply to this email directly, view it on GitHub<#14104 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAS7UM6WTZV4WTXACUKNNZLYCAD5FAVCNFSM6AAAAAA6L2AUHKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TIMRYGE4TA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Its weird I got a successful import but no data showed up. Also, looking through the initial SQL files, I could see nothing specific to my site, no IP addresses etc in the SQL file. Yet its the only file I could produce of any significant size. |
Beta Was this translation helpful? Give feedback.
-
ERROR: option "locale_provider" not recognized. I got it fixed by upgrading to Postgres 15. |
Beta Was this translation helpful? Give feedback.
-
I was setting up a new instance with PostgreSQL 16 on RHEL9 instead of PostgreSQL 12 on RHEL7 and ran into this error, when postgres is initially installed and the default db files are created with `initdb` it imports language definitions from the host OS and newer versions of postgresql support using libc or libicu for these definitions and the format for describing them has changed somewhat. I changed my postgresql_collation from en_US.UTF-8 to C.utf8 as that was what was listed in the DB and was able to install Netbox.
https://www.postgresql.org/docs/current/locale.html
It was a bit of a rabbit hole
—
Mark Tinberg ***@***.***>
Division of Information Technology-Network Services
University of Wisconsin-Madison
…________________________________________
From: Stefan Lindenberg ***@***.***>
Sent: Tuesday, April 2, 2024 5:52 AM
To: netbox-community/netbox
Cc: Mark Tinberg; Comment
Subject: Re: [netbox-community/netbox] Complete Migration? (Discussion #14104)
ERROR: option "locale_provider" not recognized. I got it fixed by upgrading to Postgres 15.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/netbox-community/netbox/discussions/14104*discussioncomment-8982443__;Iw!!Mak6IKo!IIyCY4gzcz_oi1zCvHnU8nWODen7t3CEmBo-tKAXqGrTFPZoL1FecFH4m-MGTqSny2cvrlKZ5HdD5K6K5aMICMNT$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAS7UM4SNIVMNZU4RESZICDY3KEVBAVCNFSM6AAAAAA6L2AUHKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DSOBSGQ2DG__;!!Mak6IKo!IIyCY4gzcz_oi1zCvHnU8nWODen7t3CEmBo-tKAXqGrTFPZoL1FecFH4m-MGTqSny2cvrlKZ5HdD5K6K5bXHYVyu$>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to migrate all data from a previous Netbox instance to a new one?
What's the best way to do this?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions