scragg0x / realms-wiki

Git based wiki inspired by Gollum
http://realms.io
GNU General Public License v2.0
833 stars 91 forks source link

How do i backup my wiki #191

Closed hengoldburd closed 6 years ago

hengoldburd commented 7 years ago

Hi guys very nice project its my favorite can you please tell me how to backup the db or md Files

Thanks

gazpachoking commented 7 years ago

It's backed by a git repo, so you can just push it to a remote. I happen to use github, and have a cron job scheduled to push changes there regularly.

dereks commented 7 years ago

The git repo contains the Markdown (.md) files, but not the username/password database for logins. That is stored (by default) in an SQLite database with a filename like "wiki.db". (This user database will exist unless you are running an unsecured anonymous wiki, which has no users and no database.)

An SQLite database can be backed up in multiple ways. For examples, see

http://www.quackit.com/sqlite/tutorial/backup_a_database_to_file.cfm

The simplest solution is probably to just copy the .db file, however, this is only safe for a sinlge-user Wiki. With a simple file copy, you run the risk of database corruption (like any other running SQL server) if you happen to copy the file while Realms-Wiki is busy writing to it. So you should use the .backup command (or similar).

If you are not using the default SQLite implementation, then you'll need to read the Administrator's Guide for your database of choice (for example, Maria or equivalent).

It would be much easier to backup the entire wiki (incl. users and passwords) if Realms supported a simple htaccess or /etc/passwd text file instead of just SQL. Then that text file could be managed within the git repo with the rest of the text files, and Gazpachoking's backup solution would work for everything.

scragg0x commented 6 years ago

Closing. A backup feature doesn't exist. Backup the git repo and SQL manually.