How to move from Google Notes to Nextcloud Notes

I spent a while to move my notes from google to nextcloud,but now I managed. I assume that you already did a Google Take out and I guess all your notes are stored in one directory (html and json). Wen do not need the jasons… Move them somewhere else.

Next install “pandoc” “sudo apt install pandoc”
change into the directory where your htmls are stored
create two shell scripts
-(a) one for removing blanks in the names
-(b) one for converting the html files into *.md

file a:

#change empty spaces in filenames to underlineos
for name in *.html; do mv “$name” “${name// /_}”; done

file b:

for i in ls *.html
#echo $XT
pandoc $i -f html --to=markdown_strict -o jurte_markdown_strict -o $output

Excecute both and feel free to copy all *.md to the nextcloud Notes folder
At last change to your nexcloud server and execute
docker exec -it -u www-data nextcloud-aio-nextcloud php /var/www/html/occ files:scan --all


1 Like