I'm running QuestDB 7.3.3 on Linux and I'd like to back up my database. BACKUP SQL statement seems deprecated, so I probably should use SNAPSHOT, right?
How to back up QuestDB
173 views Asked by Andrei Pechkurov At
1
There are 1 answers
Related Questions in DATABASE
- How to add the dynamic new rows from my registration form in my database?
- How to store a date/time in sqlite (or something similar to a date)
- Problem with add new attribute in table with BOTO3 on python
- When an E-R attribute should be perceived as a relationship attribute or as an entity set attribute?
- SQLAlchemy: efficient relationship loading in 3-way many-to-many relationship
- Cannot connect to Postgres Database when running Quarkus Tests with Gitlab ci
- Local or remote database with react-native?
- I want to edit a specific row in database
- How to enter data in mongodb array at specific position such that if there is only 2 data in array and I want to insert at 5, then rest data is null
- Open Web Library
- database login.py and register.py error showing 404 file not found and doesn't work
- SQL71561: SqlComputedColumn: When column selected
- Liquibase as SaaS To Configure Multiple Database as Dynamic
- Updated max input vars but table still shows error
- Spring does not map set of roles
Related Questions in QUESTDB
- Error "cannot delete file, will retry" in log
- How can I tell that a query runs multi-threaded in QuestDB?
- What transports should I use for QuestDB ingestion over the ILP protocol?
- Slow SELECT statement, possibly due to WHERE?
- Sum column depending on values from another column on a single row (Pivot columns)
- How to add Basic Auth to a Caddy config with TLS and auto renewal to Serve QuestDB via Docker
- How to import nanosecond timestamps into QuestDB via http csv import?
- How to use server-side SQL cursors with Python and QuestDB?
- In QuestDB how to efficiently query all the data for time range between 14:30 and 21:00 any day?
- Is it possible to rewrite SAMPLE BY query as GROUP BY in QuestDB?
- Is there LAG window function or equivalent in QuestDB?
- How to calculate hourly electricity consumption in QuestDB?
- Powershell command to upload CSV to QuestDB
- Why is `last` Aggregation Slower than `ORDER BY` and `LIMIT`?
- Reducing ILP Ingestion Delay in QuestDB
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
That's correct, you should use the
SNAPSHOTstatements. To make a backup, you need to put the database in snapshot mode:Next, you need to copy your database root directory somewhere on the disk:
Here, I'm using the default root directory location (
~/.questdb), but in your case the location may be different depending on your setup. Once the directory is copied, you should turn the database back into normal (non-snapshot) mode:Remember that you shouldn't run DDL statements, e.g.
CREATE TABLE, when the database is put in snapshot mode. It's fine though to ingest and query data for the existing tables while a snapshot is on-going.Finally, when you want to restore from a backup, first you need to stop your database. Next, copy the backup dir over the existing root directory contents:
Before restarting your QuestDB server, you need to set a non-default snapshot instance id in the configuration, so that the server restores the database state from the snapshot files when it starts. To do that, add the following to the
~/.questdb/conf/server.conffile:Here the exact value doesn't matter. The only requirement is that it's different from the default one (an empty string) or the one that was configured at the backup time.
Now, you can restart the database. On start, it should print something like the following into the logs when it recovers the snapshot: