Obsidian

Obsidian 101: How To Backup Your Obsidian Vault

Backup your Obsidian vault to secure your notes and knowledge. Using both the Local Backup plugin and the Obsidian Git plugin backups will ensure that your files are safe even if you lose a document.
Obsidian 101: How To Backup Your Obsidian Vault
Obsidian 101: How To Backup Your Obsidian Vault
In: Obsidian

One aspect that I really love in Obsidian is the fact that your notes (and this means your thoughts, your knowledge...) are completely yours.
You are solely responsible for their safety. That’s why making a backup of your vault is crucial.

Many people confuse Obsidian Sync or having the vault stored in a cloud service, with backup.
If you have your vault stored in a cloud service, it only means that you can access it from multiple devices.

But if you lose a file? How can you restore it? Can you rely only on the recycle bin to recover your deleted files?

I suggest you to make two backups: one local backup thanks to the Local Backup community plugin, and one on a GitHub private repository that you can maintain constantly updated thanks to the Obsidian Git community plugin.

Local Backup

How to Setup

Once you installed and enabled the Local Backup plugin, open the options panel.

Local Backup Plugin - General Settings

Here you can:

  • Decide to run a local backup every time you launch Obsidian: I prefer to not enable this since I can launch Obsidian more than one time during the day. I prefer to run a local backup manually, and I will show you how in a bit.
  • Set the backups’ lifecycle. I prefer to set it at 0 so I can manage my backups manually.
  • Decide the folder where the backups will be created.
  • The name of the backup ZIP file.
  • Enable the option to create backups at regular intervals. I don’t use this option since, as I already said, I prefer to run the backup manually.
  • Set a file archiver (7-Zip - WinRAR): this is helpful if the size of your vault is too large.

How to Run a Local Backup

To run a local backup manually is very simple. You just need to open your command palette with Cmd/Ctrl + P and click on “Run local backup”.

Run Local Backup Manually

Once you have launched the command, the plugin will create a zipped backup of your vault inside the folder you chose in the “Output path” option.

Local Backup Zip File

GitHub Backup

What is GitHub?

GitHub is like a digital platform where people collaborate on creative projects, such as writing books or making art, but for software. It helps teams work together to create and improve software by providing a place to store and manage code, track changes, and coordinate efforts. Think of it as a shared workspace where multiple individuals can contribute and keep everything organized, making it easier to build and maintain software efficiently.

Maybe now you might wonder "why should I use this platform for my backup?".

Before answering this question, it’s important to understand another component of GitHub: the GitHub Repository.

What is a GitHub Repository?

A GitHub repository is like a digital folder or container for a specific project. It holds all the files, documents, and code related to that project in one place. Just as you'd organize your work in folders on your computer, a repository keeps everything organized for yourself (private repository) or for a team (public repository). It also tracks changes made to the project, so you can see who did what and when.

Back to the previous question "why should I use this platform for my backup?", we are going to create a private repository, that will contain our entire Obsidian vault, and we will keep it constantly updated thanks to the Obsidian Git community plugin.

Configuration and Process

Install Obsidian Git

Let’s start by installing the plugin by going to Settings > Community plugins > Browse, and search for “Obsidian Git”. Install it and enable it.

Obsidian Git Installation

Install Git

Once the plugin is installed and enabled, you need to make sure to have git installed. To do that follow these steps:

  1. Open the Terminal.
Terminal
  1. Write the following command: which git.
Terminal Which Git

If you don’t have git installed:

  • For MacOS: you can simply write this command in the terminal: xcode-select --install
  • For Windows: you can download and install Git from HERE.
Download Git for Windows

GitHub Desktop

The next step is installing GitHub Desktop. This is not mandatory, but since a lot of people are not familiar with terminal, GitHub Desktop will help you to achieve the same result without using any commands!

Once you have installed it, launch it and you will see a window like this:

GitHub Desktop

If you don’t have a GitHub account, create it and once you’ve done this, you can sign in!

GitHub Desktop Logged In

Create a Local Git Repository

Now you need to create a Git Repository on your hard drive. To do that follow these simple steps:

  1. Click on “Create a New Repository on your Hard Drive…”.
(Step 1) Create a New Repo
  1. Create a folder in the same folder where your vault is located and call it whatever you want – I call it “Git Repo” – and select it.
(Step 2) Choose Local Path
(Step 2) Create and Choose the Folder
  1. Choose a name for your Repository and click on “Create repository”.
(Step 3) Name and Create the Repository
  1. Open the folder you created before – for me it’s “Git Repo” –, open the local repository – for me “test-vault-obsidian-sync” – and enable the option to view hidden files.
    • For MacOS: use the shortcut Cmd + Shift + ..
    • For Windows: go to View > Show > Hidden items.

Inside the folder you will see two files: the folder .git and the file .gitattributes.

(Step 4) Hidden Files
  1. Move that folder and that file to your vault folder.
(Step 5) Move the Hidden Files to your Vault
  1. Go back to GitHub Desktop and you should see a “Can’t find…” error.
(Step 6) "Can't find Repo Error
  1. Just click on “Locate” and select your vault folder.
(Step 7) Click on Locate
(Step 7) Select your Vault Folder
  1. Now it will see all the files you have in your Obsidian vault.
(Step 8) All the Files of your Vault
  1. You can now delete the folder you created at the step 2 of the process – for me it was the “Git Repo” folder.

Publish Your Repository to GitHub

  1. Commit your vault. Think of commit as a snapshot of your work, allowing you to save and keep track of changes you make in your vault. I name this commit “First Commit” but you can name it whatever you want, and click on “Commit to main”.
(Step 1) Commit your Vault
  1. Once this process is finished you need to publish the repository. To do that, click on “Publish repository”.
(Step 2) Publish Repo
  1. Give it a name and make sure to check “Keep this code private” or your repository will be public. Lastly, click on “Publish repository”.
(Step 3) Name and Publish the Repo
  1. If you go to your GitHub account, you will see your vault inside the repository!
(Step 4) Repository on your GitHub Account (1)
(Step 4) Repository on your GitHub Account (2)
(Step 4) Repository on your GitHub Account (3)

How to Set Obsidian Git Plugin

Finally you are ready to set the Obsidian Git plugin!

  1. If you have Obsidian opened, close and relaunch it.
  2. Go to Settings > Obsidian Git and customize the settings you want. In my opinion the most important one is the “Vault Obsidian Interval”.
Obsidian Git Vault Backup Interval
  1. If you open your command palette with Cmd/Ctrl + P and you search for “Obsidian Git: Open source control view”…
Obsidian Git Source Control View (1)

…you can see all the changes to your vault and decide to commit and push them manually!

Obsidian Git Source Control View (2)

Video Walkthrough

How To Backup Your Obsidian Vault Using GitHub

Written by
Marco Serafini
As a productivity consultant, I develop hands-off productivity systems for professionals and businesses, helping them to unlock their full potential by shifting from hard work to strategic efficiency.
Comments
More from Mindstone Consulting
Obsidian for Data Analysis
Obsidian

Obsidian for Data Analysis

Obsidian itself is a pretty nifty tool, but what if you could level up your note-taking game with interactive, dynamic charts? In this blog post, we will discover four must-have community plugins for data visualization: Charts, Contribution Graph, Heatmap Calendar, and Ledger.

You are just one click away from unlocking your full potential. Let's talk!

Book a discovery call
Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to Mindstone Consulting.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.