Unable to recover database from a local replica
Hi, there! I'm trying to recover a database by using the command litestream restore -o /tmp/db /path/to/replica.db. However, I'm getting the error database not found in config: /path/to/replica.db. Also, I tried it without specifying the -o parameter, with same error. I can only recover the database without specifying the replica parameter.
Am I making a mistake specifying the command?
Thanks in advance!
@gustingonzalez What does your config file look like?
@benbjohnson, my config file looks like the following:
# AWS credentials
# access-key-id: AKIAxxxxxxxxxxxxxxxx
# secret-access-key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxx
dbs:
- path: /tmp/source.db # Database to replicate from
replicas:
- path: /tmp/replica.db # File-based replication
So, the command that I'm using is: litestream restore -o /tmp/restored.db /tmp/replica.db.
Note that, despite this, my understanding (according to the documentation) is that a config file wouldn't be required by using this command.
@gustingonzalez If you're using a regular path then it'll try to match the database name. In that case, you'd need to specify:
$ litestream restore -o /tmp/restored.db /tmp/source.db
I believe you need to specify the replica in a URL format for it to skip the config:
$ litestream restore -o /tmp/restored.db file:///tmp/replica.db