Please follow the below template, it will help us to help you!
Please ensure that you are running the latest version of the beta code. Run pihole -up to update to the latest, then verify that the problem still exists before reporting it.
Problem with Beta 5.0:
Fresh install of Pi-hole on Fresh DietPi Buster. Tried to use teleporter from an existing install which appeared to fail.
Processed blacklist (exact) (Error: Failed to prepare statement for blacklist table (type = -1). entries)
Processed blacklist (regex) (Error: Unable to begin transaction for regex_blacklist table. entries)
Processed whitelist (exact) (Error: Unable to begin transaction for whitelist table. entries)
OK
To clarify the problem - you were able to succesfully export the settings with teleporter, but then when you tried to import them to a different Pi-Hole the error appeared?
Was the existing install of Pi-Hole (from which you exported the lists) a V4.x install?
Edit - the following information is incorrect. Apologies for providing an incorrect answer. See correct answer from developer farther down the reply chain.
If you look at the contents of a teleport export from a V4.x and V5.0 install, you will see that are quite different. The V4.x export files are all in text format (which matches the format of the data in V4.x), and the V5.0 export is primarily in json format (which is extracted from the new database) and are not in the same text format.
You cannot import a V4.x teleport export into V5.0, due to the format difference. The existing install would have to be updated to V5.x and then the teleporter export can be used by the other Pi-Hole.
That sounds like a major flaw in the upgrade path for users, it may cause a fair amount of agnst although I understand why.
If the upgrade converts the V4 format to V5, could that not be employed by the teleporter?
I took the opportunity to build a new VM on V5 (move from Stretch to Buster in the process) and I'll drop in the new VM at an appropriate time so not an unusual use case I suggest.
Might I suggest that a check on the import be done and an error message that V4 teleporter is not compatible with V5 be returned?
Well, yes, the Teleporter v5.0 can of course still read the v4.x format. In fact, the teleporter is fully backwards compatible all the way back to its creation. Well, in theory. You've hit a bug here and I wonder whether this is related to DietPi.
Could you attach the teleporter file you tried to import or send it to me via PM so I can try to reproduce this locally? After looking at the code I think I may have seen what is going wrong, however, I'd like to confirm the fix before pushing this.
and made a teleporter import afterwards from a pihole Pi-hole Version v4.3.2 Web Interface Version v4.3.2 FTL Version v4.3.1 teleporter export. Succes but no blocklists where imported! Only 7 out of 23 blocklists pi-hole-teleporter_2020-01-31_12-20-23.zip (6.0 KB)
DELETE FROM domain_audit
Processed blacklist (regex) (Error: Argument type has to be of type integer (is NULL) entries)
DELETE FROM domainlist WHERE type = 1
Processed blacklist (exact) (60 entries)
Processed static DHCP leases (0 entries)
DELETE FROM domainlist WHERE type = 3
Processed blacklist (regex) (25 entries)
DELETE FROM domainlist WHERE type = 0
Processed whitelist (exact) (34 entries)
OK
The good news
Installed a copy of the existing pihole v4.3.2 and switched to beta as anounced worked for me.
All the 23 blocklist remained in config.
...
[✓] Storing downloaded domains in new gravity database
[✓] Building tree
[✓] Swapping databases
[✓] Flushing DNS cache
[i] Number of gravity domains: 4246981 (3307567 unique domains)
[i] Number of exact blacklisted domains: 60
[i] Number of regex blacklist filters: 25
[i] Number of exact whitelisted domains: 34
[i] Number of regex whitelist filters: 0
[✓] Cleaning up stray matter
I checked the code an see that we never imported the adlists in v4.x. Chnaged now.
I'm currently coding "offline" on my phone, so no promises that this actually works... I'll check the code properly when I'm back home. If you don't beat me to it.
Sounds great, thanks.
Just let me know when its ready, and which branch i have to use. Will check for sure afterwards. (git pull gave me "already up to date" for beta 5)
Pi-hole Version vDev (release/v5.0, v4.3.2-391-ge0b3405) Web Interface Version vDev (fix/teleporter_legacy_import, v4.3.2-362-g6ad2430) FTL Version v4.3.1
importing v4 teleporter file:
[✓] Storing downloaded domains in new gravity database
[✓] Building tree
[✓] Swapping databases
[✓] Flushing DNS cache
[i] Number of gravity domains: 5300966 (3659152 unique domains)
[i] Number of exact blacklisted domains: 83
[i] Number of regex blacklist filters: 29
[i] Number of exact whitelisted domains: 40
[i] Number of regex whitelist filters: 0
[✓] Cleaning up stray matter
[✓] DNS service is running
[✓] Pi-hole blocking is Enabled