Remove mysqldump's --skip-quote-names option, it is unnecessary (as of 2024) & leads to silent error, corrupting the SQL dump. Make instructions for import the dump clearer.
parent
e001f07c57
commit
1b52eb6ec4
|
@ -39,8 +39,7 @@ mysqldump \
|
||||||
--single-transaction \
|
--single-transaction \
|
||||||
--no-create-db \
|
--no-create-db \
|
||||||
--no-create-info \
|
--no-create-info \
|
||||||
--hex-blob \
|
--hex-blob <database> \
|
||||||
--skip-quote-names <database> \
|
|
||||||
| grep -a "^INSERT INTO" | grep -a -v "__diesel_schema_migrations" \
|
| grep -a "^INSERT INTO" | grep -a -v "__diesel_schema_migrations" \
|
||||||
| sed 's#\\"#"#gm' \
|
| sed 's#\\"#"#gm' \
|
||||||
| sed -sE "s#,0x([^,]*)#,X'\L\1'#gm" \
|
| sed -sE "s#,0x([^,]*)#,X'\L\1'#gm" \
|
||||||
|
@ -51,11 +50,11 @@ You should be prompted to enter a password, enter your password and press enter.
|
||||||
|
|
||||||
This should generate a file `mysql-to-sqlite.sql` which holds your database.
|
This should generate a file `mysql-to-sqlite.sql` which holds your database.
|
||||||
Now look for the db.sqlite3 file Vaultwarden created in the previous step when you started Vaultwarden for the first time using SQLite as it's database.
|
Now look for the db.sqlite3 file Vaultwarden created in the previous step when you started Vaultwarden for the first time using SQLite as it's database.
|
||||||
Copy or move the `mysql-to-sqlite.sql` so that both `db.sqlite3` and the export are in the same directory.
|
Copy or move `mysql-to-sqlite.sql` to the same directory as `db.sqlite3`.
|
||||||
Now you can execute the following
|
Now you can execute the following
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sqlite3 db_new.sqlite3 < mysql-to-sqlite.sql
|
sqlite3 db.sqlite3 < mysql-to-sqlite.sql
|
||||||
```
|
```
|
||||||
|
|
||||||
This should have filled the SQLite database with the dump, and you can now start Vaultwarden again using SQLite instead of MySQL.
|
This should have filled the SQLite database with the dump, and you can now start Vaultwarden again using SQLite instead of MySQL.
|
||||||
|
|
Loading…
Reference in New Issue