# Migration from DBTrie backend to Postgres backend
For an extended period, NBXplorer depended on an embedded database dubbed DBTrie. This internal database imposed limitations for various reasons, prompting us to upgrade NBXplorer to employ a Postgres backend rather than DBTrie.
Although we continue to support DBTrie, it is now deemed obsolete. We offer a migration pathway for existing deployments.
|Command line argument
|Once migration succeed, delete the original DBTrie database (default: false)
|The connection string to postgres
|If DBTrie database exists, migrate it (default: false)
|Do not migrate the events table (default: false)
|Do not migrate the raw bytes of transactions (default: false)
automigrate: will seamlessly determine if a DBTrie database necessitates migration, disregarding the flag if migration is unnecessary or already executed.
nomigrateevts: may be employed for services reliant on NBXplorer that do not query past events, thereby hastening the migration process. (BTCPay Server, for example, does not utilize past events)
nomigraterawtxs: may be utilized if preserving raw transaction bytes is nonessential, consequently expediting migration. Raw transactions are typically crucial for signing with a non-segwit wallet.
The majority of instances will complete migration in under five minutes.
For larger instances, our BTCPay Server's mainnet demo server with 800,000 addresses and 44,000 transactions and the DBTrie database approximating 5GB took roughly 40 minutes.
If you use BTCPay Server, ensure that its environment variable
BTCPAY_EXPLORERPOSTGRES is assigned the same connection string as NBXplorer.
You can find more information in this blog post (opens new window).