Updated

To backup and restore a users table, follow the next easy steps.

Backup

Dump table in file users.sql

Execute in your shell

$ sqlite3 dbname.sqlite
> .output users.sql
> .dump users
> .quit

Restore

If you want to restore a Rails table and the same table name already exists, drop the table before restoring. For example for users table

$ bundle exec rails c
> ActiveRecord::Migration.drop_table(:users)

Quit console session and then to restore, execute in your shell

$ sqlite3 dbname.sqlite
> .read users.sql
> .quit