Save Your Wiki

Your pages are yours, but it's likely they are stored on somebody else's server. It is easy to save all your files from a given wiki site in a single file, which can be restored onto another Federated Wiki server if needed.

# Method 1

1. Fork this page onto your wiki (or at least, open it within the lineup of your wiki, but dragging the URL of this page onto a webpage opened to your wiki). 2. Click export.json . This will open a browser window full of JSON code. 3. In your browser "File" menu, choose "Save" and save the file to your computer.

# Method 2

Type the following, replacing "site.org" with the domain you are trying to back up, on the command line on your computer (this should work on Linux or MacOS, but not on Windows):

curl http://site.org/system/export.json >export.json

This will save a file called "export.json" into the directory where you run the command. That's your backup.

If you prefer, you can modify the file name ("export") at the end of the command, but avoid using spaces or special characters. For instance,

curl http://site.org/system/export.json >BobWikiExport.json

# Automating backup (builds on Method 2)

Here is a sample script that automates a command line based backup using a cron job:

# save a daily backup with a retention of one week # usage: sh mkbackup.sh forage.ward.fed.wiki.org site=$1 day=`date +%a` curl -s http://$site/system/export.json \ > backups/$site.$day.export.json

# What is this backup file?

The file exported above contains every page from your site, including all the story items and every journal entry. The file will be organized as an object where keys are page slugs and values are page objects.

This file can be large, ranging from dozens to hundreds of megabytes. A good strategy is to save periodically keeping the last few downloads.

# Restore

If your wiki server has lost your pages then you will want it repaired even if it then appears empty. Restoring your saved files to this server should have every page ready to work as usual.

You may need to claim your site again and accept (or modify) whatever flag color is created for your new site.

If you are moving to a new host then you will want to redirect your domain name to that server. Since sites are always subdomains, this will always be possible but may not be the policy of the owner of the domain you were hosted within.

You will need to run a script that posts each page to the server. Even a modest size site is probably too large to post in a single operation.

We intend to make restore drag and drop simple. We have yet to determine if browsers are capable of handing 200 Mb drops.