rqlite supports loading a node directly from a SQLite dump file. This is a fast and efficient manner to initialize a system from an existing SQLite database, or to restore from an existing [node backup](https://github.com/rqlite/rqlite/blob/master/DOC/BACKUPS.md). An example restore is shown below.
The following examples show a trivial database being generated by `sqlite3`, the SQLite file being backed up, converted to the corresponding list of SQL commands, and then loaded into a rqlite node listening on localhost.
### rqlite CLI
```
~ $ sqlite3 restore.sqlite
SQLite version 3.22.0 2018-01-22 18:45:57
Enter ".help" for usage hints.
sqlite> CREATE TABLE foo (id integer not null primary key, name text);
sqlite> INSERT INTO "foo" VALUES(1,'fiona');
sqlite>
~ $ echo '.dump' | sqlite3 restore.sqlite > restore.dump # Convery SQLite database file to set of SQL commands
~ $ ./rqlite
Welcome to the rqlite CLI. Enter ".help" for usage hints.
127.0.0.1:4001> .schema
+-----+
| sql |
+-----+
127.0.0.1:4001> .restore restore.dump
last inserted ID: 1
rows affected: 1
database restored successfully
127.0.0.1:4001> select * from foo
+----+-------+
| id | name |
+----+-------+
| 1 | fiona |
+----+-------+
```
### HTTP
_Be sure to set the Content-type header as shown._
**Note that you must convert the backup file (in the above examples the file named `restore.sqlite`) to the list of SQL commands**. You cannot restore using SQLite backup file.
The behavior of the restore operation when data already exists on the cluster is undefined -- you should only restore to a cluster that has no data, or a brand-new cluster. Also, please **note that SQLite dump files normally contain a command to disable Foreign Key constraints**. If you wish to re-enable Foreign Key constraints after the load operation completes, check out [this documentation](https://github.com/rqlite/rqlite/blob/master/DOC/FOREIGN_KEY_CONSTRAINTS.md).