I want to verify that my updates to the bitcoind source code don't break anything. One way that I thought of doing that was through loading the mainnet data into a regtest instance. To do that I first copied the good data folder and then ran my newly-compiled server in regtest mode pointing to my copy. I.e:

./bitcoind -server -regtest -datadir=.../my_data_copy

When I query the server it does not return any data. The debug.log file shows a number of block rollbacks. Why doesn't that work?

Is it possible to run the daemon in a way that it verifies the current code against the data on disk, such that the the current code would generate the same data? Is it possible to copy data from main or test networks and load that in the regtest mode?

I was thinking I needed to use regtest to avoid connecting to the live network. I don't need to connect to the network at all to verify the data, and I certainly don't want to broadcast anything in my test scenario.

1 Answer 1


Mainnet and regtest have different rules for the difficulty.

As their consensus rules are different, the mainnet chain will not be valid according to regtest rules or vice versa.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.