From owner-freebsd-stable@FreeBSD.ORG Thu Dec 4 19:33:44 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 704A9F71 for ; Thu, 4 Dec 2014 19:33:44 +0000 (UTC) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3488E97B for ; Thu, 4 Dec 2014 19:33:44 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1Xwc9e-0008D0-VA for freebsd-stable@freebsd.org; Thu, 04 Dec 2014 20:33:40 +0100 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: freebsd-stable@freebsd.org Date: Thu, 04 Dec 2014 20:33:33 +0100 Subject: restore a periodic backup of pkg db MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: bdb49c4ff80bd276e321aade33e76e02752072e2 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: - X-Spam-Score: -1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED, BAYES_40 autolearn=disabled version=3.3.1 X-Scan-Signature: 964c6a2bc69af72888bec91466701c23 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 19:33:44 -0000 Hi, In /var/backup is a daily backup of the pkg db. The backup is not made by 'pkg backup', but by 'pkg shell .dump' as I read in /usr/local/etc/periodic/daily/411.pkg-backup. How do I restore this properly? I can't use pkg backup -r because the backup is a file containing sql statements. Restoring by 'xzcat /var/backup/pkg.sql.xz | pkg shell' gives errors like the one below. (It does not understand hex strings very well. Regards, Ronald. [root@sheeva /var/db/pkg]# xzcat /var/backups/pkg.sql.xz | pkg shell Error: near line 33904: near "'0001308D03020101030002010104000101010300020101030001010103000E01010300060101040005010106000101010400010101040002010103000101010400030101050006010105000301010400010101040002010103000701010500040101040001010104000701010400020101040003010104000101010500060101030001010105000601010600030101030001010103030001010105000201010400010101040004010104000201010500030101040002010104000301010500010101040009010105000101010300010101040001010105000301010300020101040001010106000901010300010101030003010104000101010600020101040001010104000201010600010101060001010106000B0101030004010103000801010303000101010303000101010303000101010303000101010303000201010300080101050008010104000201010303000401010500030101040002010104000601010500010101040006010106000101010300030101040001010103000F0101050002010106000B0101030001010105000101350B0B01010600AF0101010600'": syntax error