Solved How to fix ports index database?

After upgrading fom 9.3 to 12.0 I fetched new ports index. But my ports tree is from the end of 2018 (I want to have PHP5), so index and tree were a bit out of sync.

To fix that I gave command "make index". But now I have other problem:

Code:
# portversion -v
[Reading data from pkg(8) ... - 470 packages found - done]
[missing key: virtual_categories] [Updating the portsdb <format:bdb_btree> in /usr/ports ... - 0 port entries found  ..... done]
missing key: virtual_categories: Cannot read the portsdb!
database file error

How to fix that, to have proper index and databases from my ports tree?
 
The portversion command comes from the ports-mgmt/portupgrade port, right? Just asking because I don't have it.

Anyway, the error message sounds like portupgrade's database is somehow broken. That's not related to the ports index (/usr/ports/INDEX-*).
To fix that, make sure your Ports Collection is up to date (e.g. using portsnap(8)), then force portupgrade to update its database with pkgdb -fu.

(That's just from memory, no guarantee. As I mentioned, I don't use portupgrade myself.)
 
Yes, it seems portversion comes with portupgrade.

What I have figured out so far:

If i delete/move INDEX-12 file, then with command make index new INDEX-12 file is created (takes about 10 minutes). But for some reason file size is zero!

If after then I run portversion, it creates the INDEX-12.db file. But gives the error as in 1st post. File size is very small too.

So the question is, why make index creates empty file?
 
How do you update your ports collection? If you use portsnap(8) (recommended), then it will automatically fetch an appropriate INDEX file for you. No need to run make index.
 
You could just use svn and checkout 2018Q4 branch. But really, the best thing would be to upgrade your stuff to php7x - it's not that bad! Well, sort of bad, but sooner or later, you're going to have to do it and PHP56 is EOL.
 
I was running 9.3 home server with ports tree frozen in end of 2016 state.

https://forums.freebsd.org/threads/freebsd-9-3-malformed-conditional-bsd-licenses-mk.60029/

I planned to upgrade to 12.0

Since I got info, that PHP56 port will be deleted, I planned to freeze ports tree at end of 2018 status. So I did did portsnap at 31. december 2018.

I got around to upgrading 9.3 -> 12.0 only this week. I got most of the stuff working, including 10-year old PHP application, that I want to run. Had to portdowngrade couple of ports to 2015 status to get it working.

But using the example from old thread, can I take from svn 2018-12-31 state and then copy just INDEX file from there?

The goal is to get the upgrade done and then freeze the setup again for a couple of years.
 
Well, I could not get make index to work. So simplest solution was to copy INDEX-12 file from another FreeBSD12 machine.

After that running portversion -v created new and working INDEX-12.db file.

make fetchindex did not work either:
Code:
# make fetchindex
/root/proov/INDEX-12.bz2                       27% of 2292 kB  577 kBps    02s
fetch: /root/proov/INDEX-12.bz2 appears to be truncated: 653168/2347386 bytes
*** Error code 1

Stop.
 
Back
Top