How to "Delete local files and Re-upload from sync target" in the Terminal app

In the gui version there is an option to delete the local files and re-upload everything from the sync target, I don't know if such feature exist in the terminal version, If exist how can I do that?

Honestly I would just clear your profile entirely and let Joplin make a new one, you can save your settings.json to keep most of your settings if you need.

But in theory I think it can be done?

In the desktop app there is a private setting which is controlled by the config menu button.
I haven't tried it (and you would have to do so entirely at your own risk) but you might be able to use it by setting it manually in your settings.json.

The setting in question is:

'sync.startupOperation': {
	value: SyncStartupOperation.None,
	type: SettingItemType.Int,
	public: false,
},

export enum SyncStartupOperation {
	None = 0,
	ClearLocalSyncState = 1,
	ClearLocalData = 2,
}

And 2 would be the one you would want to clear your local data.

So you would need to add:
"sync.startupOperation": 2,

I will reiterate that I have absolutely no idea if this might cause any issues to your data and I would definitely advise against using it but in theory it should work, it is part of the generic app sync library after all. If you insist then please make sure you properly backup everything before you even think about doing it.

1 Like

Thanks for that. I went with the first suggestion.

In the terminal application I just set the sync target to the folder on my local device that was holding the notes and the application automatically got everything but it was decrypted then I enabled the encryption and DONE.