Restore database error

448 views
Skip to first unread message

Rc

unread,
Oct 8, 2016, 2:52:29 PM10/8/16
to mementodatabase
I've recently upgraded my phone, and made a backup of the database with attached files.

While trying to restore database to new phone, i get no errors, but when trying to open an
entry, for every file or photo i get the error "IO_ERROR /storage/sdcard0/memento/files/[file directory and name follows]"
That was the directory in the old phone that i cannot replicate in the new phone.

I've already tried to change the settings to where the files and database are stored, to no avail.
Creating a new entry stores the files into the newly set path (i wanted it to be /storage/emulated/0/memento/files),
but it doesn't change the path in old database entries.

One thing i've noticed while restoring the database, the app creates every entry correctly. However,
even though it doesn't output an error, it doesn't create any file in the appropriate directories set in
the configurations (even with default configuration: i've tried uninstalling and reinstalling the app, and yes, it is the pro version).

Any help would be appreciated.

Thanks

Eugene Kartoyev

unread,
Oct 8, 2016, 3:09:22 PM10/8/16
to mementodatabase
You have said formerly it was in /storage/sdcard0/memento/files/[file directory and name follows]

Try changing database paths via navigation to that directory.

Sdcard0 and emulated/0 point to the same location.

Use the former path when restoring database too.

Also, you may as well place the backup file to where it was stored in your old phone (sdcard0...) and restore it using the former path.

Technically, there is no difference between the two paths, factually - programs do get confused during complex restore.

Rc

unread,
Oct 8, 2016, 3:23:13 PM10/8/16
to mementodatabase
I've already tried to do that. However i don't have that path in the directory navigation and i cannot
recreate the path "/storage/sdcard0" in the new phone. I have only the option /storage/emulated/0

However, setting the directory before and after restoring the database has no effect in previously created entries.
It still tries to point to /storage/sdcard0 in the old entries.

Currently the settings to the database location in new phone is "/storage/emulated/0/memento/memento.db"
and it's working fine. I can open entries, create new ones.

The storage database is currently "/storage/emulated/0/memento/files", and even though it stores files
from new entries, it doesn't read old files. I've even copied the old files manually to the directory
/storage/emulated/0/memento/files in the new phone (same one as the settings) and it still cannot
read them. It still tries to open "/storage/sdcard0/memento/files/" given the IO_ERROR mentioned
above.


Eugene Kartoyev

unread,
Oct 8, 2016, 3:41:22 PM10/8/16
to mementodatabase
It's bizzare you don't have it in your device. In my Samsung, I do.

Check it again. If you are sure you don't have it, then - oops! - getting paths right becomes a bit more complicated. Do the following:

0. Make sure your files ARE on the phone already and the only issue is about that sdcard0-emulated/0 alternatives.

If pix and stuff are really there, then

1. Link your library to google sheets.
2. UNCHECK upload the attached files.
3. Synchronize.
4. Go to Google Sheets and open your library there.
5. Change the paths to the correct ones in the pic cells - manually or using find & replace - you can change one cell at first, just for a test.
6. Go back to Memento and resync the library.

If your files are in the path you will specify, they will get restored. It's a tip on how to change a pic path in the memory. For new records, files will be stored in where you have specified in the new phone settings, so, no need manipulating that.

Message has been deleted

Rc

unread,
Oct 8, 2016, 10:35:24 PM10/8/16
to mementodatabase
After a couple of hours of messing with the phone (both new and old are samsung) i can surely say
that there is no sdcard0 folder in the new model. I do have a great number of symlinks that all point to the same place:
- /mnt/sdcard;
- /sdcard;
- /storage/emulated/0 (it seems i don't have permissions to open this folder in the file manager,
don't exactly know why, even though it works fine in memento directory browser)
Last phone was android 4.1.2, new one is 6.0.1, don't know if it has anything to do with this problem.

Anyway, a couple of hours more syncing with google drive and search/replace
i finally got libraries to open the files with your solution (replacing "sdcard0" with "storage/0")

Thank you for your help. I will add my voice to another user in the request section
that mentioned that an option to sync/export multiple (or all) libraries at the same time
would certainly save a lot of time in this kind of work. :)

Just out of curiosity, couldn't this have been done a lot faster by editing de *.db file in the
backup directory before importing? I didn't want to mess a lot with it, but doesn't the table
tbl_flex_content2 hold the location of the files? Couldn't it just be changed right there
with a little bit of sql? Are there any other locations to change this information in the
table schema?

Best regards

Eugene Kartoyev

unread,
Oct 8, 2016, 10:48:40 PM10/8/16
to mementodatabase
Actually, you do have synchronization of all libraries. Probably, your problem was that some of your libraries with links to files had not been previously linked to Google Sheets, therefore this stressing time you had to do it library by library. 

Next time, before a major upgrade, backup your memento files to telephone, and to GS, just in case you need to make such a leap in Android versions and it turns out that because of drastic differences in file systems your links to external files become unusable. Your situation, however, was not typical. Hard work, but let's say, it was also a ĺesson on how to handle links to pics, which are not controllable via a list view. You can also use this technique of two-way synching to substitute the file links with other things. Say, with a link to a picture on a site. Or to change a field type without losing data. So, you may find it useful some day.

For a good file manager, download Total Commander. The native one is garbage on all Android devices, bringing about more headache than help. As for hacking the db file, I wouldn't advice messing up wìth the internal structure, although why not give it a try, if you have sql tools and skills for that ...

In any case, it's great to hear that you finally resolved your issue and congratulations on a good buy! IMO, Samsung Android 6 fully meets the contemporary good tech expectations.

Attached is a photo of mass synchronization button for libraries that have been linked to GS.   
Screenshot_2016-10-09-05-06-29.png
Reply all
Reply to author
Forward
0 new messages