Home
Softono
outline-export

outline-export

Open source MIT Go
37
Stars
3
Forks
4
Issues
0
Watchers
1 month
Last Commit

About outline-export

utility to export outline collections/documents for usage of backup, replication, etc

Platforms

Web Self-hosted

Languages

Go

Links

logo

:link: Table of Contents

:grey_question: Why

outline-export is a tool to export your Outline collections/documents to a variety of formats. You can do this manually, but it's helpful to do on an automated basis.

:computer: Installation

Check out the releases page for prebuilt versions.

:whale: Container Images (ghcr)

You will need to generate an api token in Outline (settings/api-and-apps) and replace the example token in the below command.

$ mkdir -vp backups/
$ docker run -it --rm -e TOKEN=ol_api_1234567890 -v $PWD/backups:/backups ghcr.io/lrstanley/outline-export:latest \
    outline-export \
    --url "https://outline.example.com" \
    --export-path "/backups/" \
    --extract \
    --format markdown

[!NOTE] If your instance of Outline is LAN only you may need to run outline-export on the host network. You can do this by including --network host on the first line (docker run -it --rm --network host...)

:toolbox: Build From Source

Dependencies (to build from source only):

  • Go (latest)
  • Make (version doesn't really matter)

Setup:

git clone https://github.com/lrstanley/outline-export.git && cd outline-export
make
./outline-export --help

:gear: Usage

See USAGE.md for cli flags and environment variables for full usage.

Behind the scenes, this invokes the Outline API, and does the following:

  1. Fetch current exports (if any) created within the last 1 hour, that match the format we're expecting.
  2. If no exports are found, create a new export.
  3. Wait until the export is ready, then download the export.
  4. If --extract is true, we extract the export zip, serialize all file names, and write into the target directory.
  5. Once completed, we clean up any exports that were created in the last 1 hour, that match the format we're expecting (to ensure we're not creating a bunch of exports that are left around).

:hammer: Generating a Token

To generate a token, go to "Settings" > "API & Apps" > "New API Key".

The following scopes are required, however, you can also leave the box blank just in case any others are needed in the future:

collections.export_all fileOperations.info fileOperations.list fileOperations.redirect fileOperations.delete

:bulb: Examples

Export all documents in a collection to markdown files in a directory:

$ export TOKEN="1234567890"
$ outline-export \
    --url "https://outline.example.com" \
    --export-path "your-export-path/" \
    --extract \
    --format markdown

Export the entire backup zip for archival purposes:

$ export TOKEN="1234567890"
$ outline-export \
    --url "https://outline.example.com" \
    --export-path "outline-backup-$(date +%Y-%m-%d).zip" \
    --format markdown

:raising_hand_man: Support & Assistance

  • :heart: Please review the Code of Conduct for guidelines on ensuring everyone has the best experience interacting with the community.
  • :raising_hand_man: Take a look at the support document on guidelines for tips on how to ask the right questions.
  • :lady_beetle: For all features/bugs/issues/questions/etc, head over here.

:handshake: Contributing

  • :heart: Please review the Code of Conduct for guidelines on ensuring everyone has the best experience interacting with the community.
  • :clipboard: Please review the contributing doc for submitting issues/a guide on submitting pull requests and helping out.
  • :old_key: For anything security related, please review this repositories security policy.

:balance_scale: License

MIT License

Copyright (c) 2025 Liam Stanley <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Also located here