Fossil User Forum

Repository database file backup
Login

Repository database file backup

Repository database file backup

(1) By r0bur on 2020-05-21 13:27:57 [link] [source]

Fossil repository works in self-hosting mode ("fossil server repo.fossil" started). I would like to backup the repository database file "repo.fossil" periodically. How do I do this safely (without chance to lose uncommitted database transaction, unsynchronized filesystem cache etc)? Must I stop the server using a command like "kill {Fossil process Id}" before copying? May I copy "repo.fossil" online?

I have read this article about SQLite database backup but this assume some external tool. Does the Fossil have a builtin feature for repository files backup?

(2) By Stephan Beal (stephan) on 2020-05-21 14:02:42 in reply to 1 [link] [source]

When you synchronize a fossil repo, every copy is automatically a full-fledged, standalone copy which acts as a backup. Certain information is not synced by default, namely transient configuration details like the skin and users, but all SCM's data is. See the "config" command for how to also pull the other information.

(4) By r0bur on 2020-05-21 14:24:10 in reply to 2 [link] [source]

Thank you for the reply. My question was because I need to backup full information byte-to-byte (including usernames and passwords). So generic sync is not the solution. But I will check the "config" command you recommend.

(6) By anonymous on 2020-05-21 15:13:03 in reply to 2 [link] [source]

So would this do the trick if you cloned the repo

https://example.com/remoterepo

into myrepo.fossil using credentials with admin rights? Does fossil config pull all require setup rights?

#! /bin/sh

fossil pull -R myrepo.fossil
fossil config pull --overwrite all -R myrepo.fossil

Also I noticed that config pull areas don't include forum. Does this back up pending forum requests?

If you have local access to the fossil repo will:

echo .backup myrepo_bak.fossil | fossil sql -R myrepo.fossil

work to copy the repo safely?

-- rouilj

(3) By Richard Hipp (drh) on 2020-05-21 14:10:37 in reply to 1 [link] [source]

There is a bullet for implementing a "fossil backup" command on the To Do List.

In the meantime, you could just do:

   fossil sql -R $YOURREPO "vacuum repository into '/tmp/repo.backup'"

(5) By r0bur on 2020-05-21 14:28:21 in reply to 3 [source]

This will be exactly the feature I need (and many other users I hope, too). Thank you!

(7) By anonymous on 2020-05-23 00:31:29 in reply to 3 [link] [source]

fossil sql -R $YOURREPO "vacuum repository into '/tmp/repo.backup'"

What is the corresponding restore "command"?

(8) By Warren Young (wyoung) on 2020-05-23 03:06:06 in reply to 7 [link] [source]

What is the corresponding restore "command"?

$ cp /tmp/repo.backup $YOURREPO

See the Fine Manual.