-
Is there a recommended solution to migrating SQLcipher Legacy=3 to Legacy=4 I tried using "Vacuum into " with a connection with Legacy = 3 and then using Legacy = 4 It resulted in a new DB but neither Legacy 3 or 4 would open it. Using the following works to do 3 to 3 or 4 to 4 Perhaps I missed something? In the past I have just created a new 4 DB and copied over the data but thought the Jon |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The approach you chose, that is using the SQL command
This is only surprising at first glance. At second glance it becomes clear that this has something to do with the database's page size. The default page size of a SQLCipher Legacy 3 database is 1024 bytes, while the default page size of a SQLCipher Legacy 4 database is 4096 bytes. However, the command Try to open the resulting database with the parameters
Yes. Actually, you have to explicitly request a page size of 4096 bytes for the destination database. Fortunately, the To get a SQLCipher Legacy 4 database you have to issue a -- Open SQLCipher Legacy 3 database as usual
-- Request the desired page size for the destination database
PRAGMA page_size=4096;
-- Create database copy via VACUUM INTO
VACUUM INTO 'file:dest.db?cipher=sqlcipher&legacy=4&key=pswd';
Actually, |
Beta Was this translation helpful? Give feedback.
-
Great... Jon |
Beta Was this translation helpful? Give feedback.
The approach you chose, that is using the SQL command
VACUUM INTO
, is in principle the right one. However, there's a little trap lurking, and that's the database's page size.This is only surprising at first glance. At second glance it becomes clear that this has something to do with the database's page size. The default page size of a SQLCipher Legacy 3 d…