Overview of Synchronization Solutions#
I have been using Obsidian for two years, and for multi-device synchronization of Obsidian, I ultimately adopted the following synchronization and backup solutions:
- Synchronization using Alibaba Cloud OSS
- Windows scheduled tasks to compress the Obsidian directory to another folder for backup
Explanation of Reasons#
Why did I choose this method?
Previously, I used OneDrive synchronization + GitHub repository for backup.
Insufficient OneDrive Synchronization#
However, OneDrive does not provide WebDAV service (or I couldn't find it), so I used the Koofr tool to generate a OneDrive WebDAV service. This method is not ideal because Koofr services can be unstable at times and the speed is not good, often causing the remotely-save plugin to fail to synchronize (after all, it is not an official service).
Insufficient GitHub Backup#
As for backups, I periodically synchronized the entire Obsidian library file to a GitHub repository, which includes my Obsidian configuration (of course, it's a private repository). However, I recently found that my backup directory is getting larger and larger (1.5GB), and when checking the Obsidian library file, it is only 250MB. Looking at the .git file, oh my, there is over 1GB. I am not a programmer, so I am afraid to delete anything. If I keep the current situation, the next time I migrate the system, I will have to copy the entire directory to achieve seamless backup. Moreover, I found that my git push is very slow now (not a network issue).
Backups are really super, super important. Losing notes like this can be extremely stressful. I once forgot to back up my notes during a system reinstall, and while I was feeling sad, I suddenly thought: hey, didn't I back up the entire Obsidian folder on GitHub? I just pulled it down, and there was no loss; the notes came back, and not a single configuration was lost.
Implementation of the Solution#
Alibaba Cloud OSS Synchronization#
Since I am not using OneDrive for synchronization, what about other cloud storage services? I previously used JiuGuoYun, but the synchronization experience was not great, it was unstable, and the monthly traffic was only 1GB, which is enough for note-taking, but I have other synchronization services. Considering the current shortcomings, I ultimately decided to use Alibaba Cloud (other providers like Qiniu Cloud are also fine) OSS, purchasing a 3-year 40GB standard resource package for 27 yuan (for files that require frequent read and write, it is better to buy a standard resource package). The price is quite affordable, 40GB is enough for note-taking, and it can also be used to build an image hosting service.
Configuration Needed on Alibaba's Side#
First, purchase an Alibaba Cloud Object Storage OSS resource package. I bought the 3-year 27 yuan 40GB standard version package, which can be purchased according to your needs.
After purchasing, go to the console, click on the Bucket List
on the left, create a Bucket, name it whatever you like, choose the region closest to you, and ignore the rest.
After creation, enter the Bucket, click on Data Security
and then Cross-Origin Settings
, create a rule, and fill in the Source
as:
app://obsidian.md
capacitor://localhost
http://localhost
Check all Allowed Methods
, and for Allowed Header
, fill in: * , then click OK to finish.
Next, you need to authorize a user to access and manage the Bucket. Click on the profile icon in the upper right corner of Alibaba Cloud and select AccessKey Management
. If it shows this, click Start Using Sub-user AccessKey
.
Next, we will arrive at the user management interface of identity management. Create a user login name and display name arbitrarily; here I set it to be consistent with the name of the Bucket I created for easy identification. Remember to check OpenAPI Call Access
for the access method, and after clicking OK, it will display your AccessKey ID
and AccessKey Secret
. Copy this down, as this page will only show it once.
Then we return to the Bucket page and click on Permission Control
and then Bucket Authorization Policy
, add a new authorization for the user we just created. Check Sub-account
for Authorized User
, then select the user we just created, check Full Control
for Authorized Operations
, ignore the rest, and click OK to complete the Bucket policy authorization.
Configuration Needed on Obsidian's Side#
Here we still use the remotely-save plugin. Friends who haven't installed it can search and install it directly in the community plugin market (a proxy tool is needed).
For the remote service of remotely-save, we choose S3 or S3-compatible services
. Then we return to the Bucket management interface, where we need to find the service address (Endpoint) and region. Click on the Bucket's Overview
, copy the corresponding information for the region node, and paste it into Obsidian. Then paste the AccessKey ID
and AccessKey Secret
that we copied when creating the user into the corresponding positions, and fill in the name of the Bucket you created.
If you encounter an error accessing the corresponding Bucket due to an incorrect region during synchronization, you can change the region to ap-east-1. According to the official documentation, this corresponds to the Hong Kong region in the Asia-Pacific area.
At this point, the synchronization part has been configured. Click to check if it can connect. If it can connect, it means the configuration is correct. You can set up automatic synchronization in remotely-save. I generally set it to automatically synchronize every 5 minutes
and automatically synchronize 1 second after startup
.
Windows Scheduled Task Backup#
As mentioned earlier, the backup issue is that the .git folder is too large. It is said online that you can delete the .git folder and start a new repository, but this cannot fundamentally solve the problem and is cumbersome. Moreover, Git itself has slow backup speeds in China. I have now abandoned this method. After thinking for a long time, I decided to use Windows scheduled tasks to compress the entire Obsidian folder with WinRAR and back it up to the D:\Backups directory every time I turn on the computer (my Google Drive syncs this directory). The specific steps are as follows:
Press win+R, type taskschd.msc
, hit Enter, click on Create Basic Task
on the right, fill in the name and description arbitrarily, select When the current user logs on
for the task start time, and choose Start a program
for the task action. Fill in the path to the WinRAR program for the program or script, and for optional arguments, fill in:
a -r -ep1 -ibck "parameter1" "parameter2"
If you are a 7zip user, fill in the path to the 7zip program for the program or script, and for optional arguments, fill in:
a -r -bb1 -bd "parameter1" "parameter2"
Parameter1 specifies the path and name of the compressed file, for example, here I write D:\Backups\obsidian, which will compress it to D:\Backups\obsidian.rar; if it is 7zip, it will default to obsidian.7z, but you can also specify the file type by changing parameter1 to D:\Backups\obsidian.zip, which will compress it to a zip file.
Parameter2 is the address of your Obsidian library folder.
This completes the setup. I often use Google Drive for backups because it allows you to choose the backup directory freely, and the speed is good (of course, a proxy is needed). You can also set parameter1 to your OneDrive path (on Mac, it would be iCloud), so it can automatically back up to the cloud.
In Conclusion#
It should be noted that after purchasing the Alibaba Cloud OSS resource package, you also need to pay for upload and download traffic. Pricing details for Object Storage OSS resource package (monthly)
So remember to recharge some money for your Alibaba Cloud account. For notes, the traffic generally won't be too much; it may not even exceed six yuan in a year, but if the account is overdue for too long, it may be reclaimed (there will be overdue reminders, and the overdue amount is generally 10 yuan). So to be safe, it is better to recharge 5 yuan for your Alibaba Cloud account.
The experience brought by payment is certainly a qualitative improvement. The synchronization speed of Alibaba Cloud OSS is really fast and smooth.
Important things require the "three backups" principle. Here we count one copy locally, one copy for the compressed file, and one copy for the cloud compressed file, thus adopting this principle. No matter when,
Remember to back up!! Remember to back up!! Remember to back up!!