Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to recover database from a local replica #444

Open
gustingonzalez opened this issue Nov 18, 2022 · 3 comments
Open

Unable to recover database from a local replica #444

gustingonzalez opened this issue Nov 18, 2022 · 3 comments

Comments

@gustingonzalez
Copy link

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!

@benbjohnson
Copy link
Owner

@gustingonzalez What does your config file look like?

@gustingonzalez
Copy link
Author

@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.

@benbjohnson
Copy link
Owner

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants