We have moved to a new Sailfish OS Forum. Please start new discussions there.
7

[bug] [solved] Calendar missing every non-repeating event after upgrade to 1.1.1.27 [answered]

asked 2014-12-20 13:55:13 +0300

Kim gravatar image

updated 2015-01-05 21:46:45 +0300

Hi

My upgrade to 1.1.1.27, went smoothly without any problems ... well so I thought until I discovered that I only have repeating events and birthdays in my calendar, everything else is missing!

I have tried to restore the backup, made when I upgraded, but with same result!

Events created after the upgrade is shown.

Are there any way I can see what's in the database?

Kim

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by Kim
close date 2015-01-05 21:47:16.289579

Comments

My events are still there. I do sync with Exchange, which may have helped. Good luck with your problem!

rob_kouw ( 2014-12-20 16:22:03 +0300 )edit

I have the same thing. I made a backup as described below before the upgrade, events gone, restored the backup, events still gone. the db file is 414KB in size.

bennypr0fane ( 2015-01-02 17:12:09 +0300 )edit

2 Answers

Sort by » oldest newest most voted
2

answered 2015-01-05 21:46:02 +0300

Kim gravatar image

Thanks to the comments from jovirkku and jjaone, I have solved the problem.

For some reason the update have deleted all calendars except "Default" and "Birthdays", and it would seem I have (mostly) been using the calendar "Personal" (probably because this was the one imported from my N9).

Using Sqlite3 i exported the table Components to a csv file, using the following commands:

devel-su
cd /home/nemo/.local/share/system/privileged/Calendar/mkcal
sqlite3 ./db
.header on
.mode csv
.once /home/nemo/db.csv
select * from Components;

To get an idea of what calendars existed, and what their id was, I also executed the command:

select * from Calendars;

I then transferred db.csv to my laptop, and imported it into a spreadsheet.

I found the Notebook id of the missing entries, and reactivated them using this command:

update Components 
set Notebook="[new notebook id]", DateDeleted=0 
where DateDeleted=[DateDeleted] and Notebook="[old Notebook id]"

Where:

[new notebook id] is the id of the notebook you want the entries to appear in.

[DateDeleted] is the Linux time stamp of the update (also the value you'll find in the field DateDeleted on the calendar entries), in my case this was 1418927775.

[old Notebook id] the value in the field Notebook on the calendar entries.

I hope this helps someone.

Kim

edit flag offensive delete publish link more

Comments

I don't understand the second part of your solution. Is it correct that you didn't actually edit the db file, you only used the spreadsheet application to look at it and out the Notbeook Id of the entries that you wanted, yes? My Notebook IDs llok something like this: e5d98e0a-5501-4c73-9495-86bb40b87f1f What do you use instead for the new notebook ID? Did you have to do this procedure of 2 commands (update, set) for each entry you wanted to restore to your calendar?

bennypr0fane ( 2015-02-01 21:16:48 +0300 )edit

Hi

The 'Update components' ... is the editing.

Well I suppose I could have been a bit more specific.

The "select * from Calendars;" will show you which calendars exist on your phone, each records starts with a long id like the one in your example, followed by a name. In my there are three: Default, Birthdays and Default calendar. Default is the system default (personal), Birthdays is birthdays, and Default calendar is my owncloud calendar. From this you find the id of the calendar you want your old entries moved to.

In the db.csv you find the calendar id from on of your missing events, and use it and the one you found in above to fill out the "update ..." statements. This will move all events from the old calendar with that specific id and delete date to the new calendar.

If you have lost more calendars (as I had) you repeat this for each unique calendar id in the db.csv.

I hope this helps.

Kim ( 2015-02-01 23:19:26 +0300 )edit
0

answered 2015-01-02 11:21:08 +0300

jovirkku gravatar image

Unfortunately the Personal (local, non-synced) calendar events are not included in the backup of SailfishOS.
The calendar database resides in /home/nemo/.local/share/system/privileged/Calendar/mkcal. You will need the super-user rights for viewing this folder, so:

systemctl --user stop msyncd.service
devel-su
ls -la /home/nemo/.local/share/system/privileged/Calendar/mkcal

If the file db is of considerable size (kilobytes at least) then it probably contains your calendar events. I am afraid there may not be a good way of viewing the database file db (does anyone know?). With command cat db you may see some plain text here and there, though.

It is best to restart the phone after this.

edit flag offensive delete publish link more

Comments

Those db files are Sqlite3 databases and can be queried and manipulated in.Jolla with sqlite3 command:http://www.sqlite.org/cli.html

foss4ever ( 2015-01-02 11:45:20 +0300 )edit

so, saving to a .csv file and importing into a spreadsheet application will let you view and edit the db.

bennypr0fane ( 2015-02-01 21:19:13 +0300 )edit

Question tools

Follow
5 followers

Stats

Asked: 2014-12-20 13:55:13 +0300

Seen: 624 times

Last updated: Jan 05 '15