From nobody Mon Nov 29 11:22:01 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BC26518C04C4 for ; Mon, 29 Nov 2021 11:22:11 +0000 (UTC) (envelope-from jamie@catflap.org) Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [IPv6:2001:19f0:300:2185:123::1]) by mx1.freebsd.org (Postfix) with ESMTP id 4J2jcM4vfCz3h09 for ; Mon, 29 Nov 2021 11:22:11 +0000 (UTC) (envelope-from jamie@catflap.org) Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [104.207.135.49]) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5) with ESMTP id 1ATBM2pi034287; Mon, 29 Nov 2021 11:22:02 GMT (envelope-from jamie@donotpassgo.dyslexicfish.net) Received: (from jamie@localhost) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5/Submit) id 1ATBM1vp034286; Mon, 29 Nov 2021 11:22:01 GMT (envelope-from jamie) From: Jamie Landeg-Jones Message-Id: <202111291122.1ATBM1vp034286@donotpassgo.dyslexicfish.net> Date: Mon, 29 Nov 2021 11:22:01 +0000 Organization: Dyslexic Fish To: freebsd-current@FreeBSD.org, dclarke@blastwave.org Subject: Re: pkg sqlite database borked ( again ). How to restore? References: <4d9d5406-c257-e5cb-d237-d26889468f62@blastwave.org> In-Reply-To: <4d9d5406-c257-e5cb-d237-d26889468f62@blastwave.org> User-Agent: Heirloom mailx 12.4 7/29/08 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (donotpassgo.dyslexicfish.net [104.207.135.49]); Mon, 29 Nov 2021 11:22:02 +0000 (GMT) X-Rspamd-Queue-Id: 4J2jcM4vfCz3h09 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N Dennis Clarke via freebsd-current wrote: > europa# xz -dc /var/backups/pkg.sql.xz.3 > /var/db/pkg/local.sqlite.dump > > europa# > europa# pkg backup -r /var/db/pkg/local.sqlite.dump > Restoring database: > Restoring: 100% > pkg: sqlite error while executing backup step in file backup.c:98: not > an error The backup file consists of sql statements, the pkg backup -r I think requires a binary db file. I think you need to do this: pkg shell < /var/db/pkg/local.sqlite.dump Cheers, Jamie