# How to restore a backup of local.sqlite or re-create the package database.



## Alain De Vos (Apr 4, 2020)

In a rare occasion or by accidental removal the package database local.sqlite can have a problem making "pkg info" not work anymore or being empty.
/var/backups should have older versions, even from the day before.
How to re-create the database, or restore the pkg database from the var backup, or create an empty database ?


----------



## cvnmjs (Apr 11, 2020)

I think the `pkg backup` should preform this task after looking thru the man page.

See 4.4.8. Restoring the Package Database of https://www.freebsd.org/doc/handbook/pkgng-intro.html
*Cheers*


----------

