Note committed on 29 May 2011, tagged Wikidpad
Problem:
This part of my work usually includes talking to customers, writing meeting minutes, project documentation, noting the ideas, referring and updating these records while I actually code. This is a trivial task if you do everything from one laptop which you carry around. But I've got around 3 to 4 computers which I constantly switch depending on situation.
This is where you start looking for a kind of software which could be
- a central point where you put all your notes
- synchronized between all your computers
- free/opensource
Googling didn't yield any acceptable results. Most of the findings were online solutions which I am a bit paranoid about (send your private data to someone you don't know?). Others have had a single database without a possibility to synchronize. The rest of them were not free.
So I went back to good old WikidPad and looked at it from a different angle.
First of all I must say it is the most convenient, most geeky-looking, and most simple yet powerful offline wiki database I've ever seen. It has a few storage options, one of them is "original_sqlite". It is the most convenient way to store all your notes. Yet it doesn't have a built-in possibility to synchronize.
Today I have come up with a Wikidpad synchronization solution.
It is very simple: git + sqlite cli + wikidpad database.
For those who have similar needs, here is what I've done to achieve that:
- download wikidpad, msysgit, sqlite cli
- create your wikidpad database using the original_sqlite data storage option.
- copy the sqlite3.exe to the root folder of your wikidpad database
- create two files, one for dumping the db to text file, another one for reading it back:
dbdump.bat:
dbimport.bat:
cat dbdump.sql | sqlite3.exe data/wikiovw.sli
- execute both to see they really work
- add everything to source control except (create .gitignore file and state all the exceptions): data/wikiovw.*
- push it to the central repo
With this you will have your notes synchronized on all of your locations, you'll have total control over the change history, and last but not least, be easily able to resolve any conflicts that will inevitably appear from time to time.
I am using git, but I am sure this is possible to do on all revision control software. With git you can go further and add those dbdump/dbimport commands to hooks (haven't tried these yet) and everything will be totally automated.
======= Add new comment =======
======= Add new comment =======
Comments
===== Commented by Alex@vo1dmain on 01 June 2011 =====
Here is the updated version of dbdump.bat
rm dbdump.sql
for i in `echo '.tables' | sqlite3.exe $db`; do
echo $i
echo '.dump '$i | sqlite3.exe $db > tmp
cat tmp | grep -v -e "INSERT " -e "COMMIT;" >> dbdump.sql
cat tmp | grep -e "INSERT " | sort >> dbdump.sql
echo 'COMMIT;' >> dbdump.sql
done;
rm tmp
The problem with the original one is that sqlite dump insertion order is always different, even if nothing was changed, the lines in dump file were moving from one place to another, making it difficult to track the changes. What this bash script (works in msysgit) does is sorting the insert statements while leaving all others at the beginning of the file.