2
# This file is part of the KDE project
3
# Copyright (C) 2004-2005 Jaroslaw Staniek <js@iidea.pl>
5
# This program is free software; you can redistribute it and/or
6
# modify it under the terms of the GNU General Public
7
# License as published by the Free Software Foundation; either
8
# version 2 of the License, or (at your option) any later version.
10
# Performs migration from SQLite2 format to SQLite3 format
11
# usage: ksqlite2to3 <sqlite2-db-file>
13
if test $# -lt 1 ; then
14
echo "usage: ksqlite2to3 <sqlite2-db-file>"
18
basename=`basename $0`
19
temp=`mktemp -q "$basename"-XXXXXX 2> /dev/null || date +%y%m%d%H%M2`
23
ksqlite2 $dbfile .quit 2> /dev/null
24
if test $? -ne 0 ; then
25
echo "This file is not in SQLite2 format"
30
ksqlite2 -verbose-dump $dbfile .dump | ksqlite "$dir/$temp"
31
if test $? -ne 0 ; then
32
echo "Error during converting"
37
mv "$dir/$temp" $dbfile 2> /dev/null || exit 3