Posts: 277
Threads: 45
Joined: Oct 2014
Reputation:
0
I would have thought that for the "Marshmallow" problem you just need a way of doing a search and replace in the database. Change all occurrences of "sdcard1" to "xxyendaow". No files need to move whether managed by MSPro or not.
Personally I can't imagine a reason why I would want anything more. There are already ways to move file to different locations if you really want to, but I don't see it as something you would want to do on a regular basis. So not having a nice UI isn't a problem.
Andy
Posts: 1,049
Threads: 112
Joined: Dec 2015
Reputation:
12
> I would have thought that for the "Marshmallow" problem you just need a way of doing a search and replace in the database.
I thought so, too. But it doesn't seem to be that simple.
Sciurius, no way for some pearl script to do that?
Posts: 1,903
Threads: 296
Joined: Sep 2014
Reputation:
33
It's probably nothing that a user willingly does frequently. It is caused by Android. Making a backup, update Android or change to a tablet with a different Android version, then restoring the MSP backup. That should be a normal, working process. There are cases where that fails badly because Android caused paths to disappear completely and makes it even impossible to create the dissappeared paths manually.
Posts: 1,234
Threads: 194
Joined: May 2015
Reputation:
13
I've added a tool msb_reloc that copies a msb backup set and changes the prefix of all path names in the database. The resultant backup set should be restorable in the new location.
Mike: Do you think anything else is needed?
Code: msb_relocate.pl
This tool copies an MSPro backup set, changing path prefixes,
effectively relocating the backup set to be restored to a new
location.
Usage:
Copy the backup set from the tablet onto the PC.
perl script/msb_reloc.pl --src=/storage/sdcard1/ --dst=/storage/0123-4567/ MobileSheetsProBackup.msb
(Note: You may need to adjust the path to perl, the script and the
backup set if they are not accessible from the current directory.)
The new backup set will be called MobileSheetsProBackup_reloc.msb.
You can verify its contents with msb_unpack.
If the relocation is okay, copy the new backup set to the (new)
tablet and restore it.
https://github.com/sciurius/MSPro-Tools
As usual, use at your own risk.
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Posts: 1,049
Threads: 112
Joined: Dec 2015
Reputation:
12
I will test that when I'm home and report. Sounds good and would be exactly what I need with a minimum of effort and changes. Hope it works.
Posts: 1,049
Threads: 112
Joined: Dec 2015
Reputation:
12
03-14-2016, 09:21 PM
(This post was last modified: 03-14-2016, 09:47 PM by BRX.)
Johan, before I start, would it be possible to make a pearl script directly working with mobilesheets.db ?
Mike, I know you had reservations about the option to backup the database without including the source files. But because of the Marshmallow problem and because I often change metadata, cropping etc. without changing the source files I'd appreciate an option to exclude the source files from the backup.
Posts: 1,234
Threads: 194
Joined: May 2015
Reputation:
13
Sure, no problem. But not until tomorrow. I have a rehearsal tonight.
Are you trying to copy the database from one install to another, only adjusting paths, and do so regularly?
Effectively copy metadata from one install to the other?
BTW: The name is Perl, not Pearl.
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Posts: 1,234
Threads: 194
Joined: May 2015
Reputation:
13
If you want to go the database-only route, you can of course dump the database into sql, use any convenient text editor to make the changes, and recreate the database from sql.
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Posts: 1,049
Threads: 112
Joined: Dec 2015
Reputation:
12
> BTW: The name is Perl, not Pearl.
Huh, I know that. Damn advertisements I get always in the mail ;-)
> Are you trying to copy the database from one install to another, only adjusting paths, and do so regularly?
Yes, that's what I'm trying to do generally speaking. So far I synced my MSP installs on my tablet and my cell simply by copying the content of com.zubersoft.mobilesheetspro from my tablet to my cell (while the source files on the SD cards remained unchanged or I synced them manually).
See the other thread where I suggested that to Graeme for installing on multiple tablets.
This worked without problems because they had the same paths with "sdcard1". If it works with a perl (!) script to simply replace the paths directly in mobilesheets.db (also needed in mobilsheets.db-journal maybe) I can and will happily continue to do so.
(I tried a simple ASCII replace already since the paths could be seen in clear text. But as I expected the database doesn't work at all after that)
In particular right now I'm trying to use my unchanged mobilesheets.db mobilsheets.db-journal from before the upgrade. I copied them directly before the upgrade to Marshmallow.
Posts: 1,234
Threads: 194
Joined: May 2015
Reputation:
13
(03-15-2016, 02:53 AM)BRX Wrote: This worked without problems because they had the same paths with "sdcard1". If it works with a perl (!) script to simply replace the paths directly in mobilesheets.db (also needed in mobilsheets.db-journal maybe) I can and will happily continue to do so.
I think Mike's suggestion to implement relative paths is much better... No more path tweaking necessary.
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Posts: 1,049
Threads: 112
Joined: Dec 2015
Reputation:
12
> I think Mike's suggestion to implement relative paths is much better... No more path tweaking necessary.
True. But I expect it will take a while. I'd be happy for an immediate solution to make my database functional again.
I tried your script. First problem I had was that Marshmallow didn't let me backup to the SD card. No location was writable. Something else Mike will have to deal with.
But since MSP had no access to the source files the backup was small and I could write to internal storage and copy from there.
I couldn't use msb_reloc.pl successfully though. When I used the parameters
--src=/storage/sdcard1/ --dst=/storage/6630-6438/ MobileSheetsProBackup.msb
it just produced a 6.715 kb MobileSheetsProBackup_reloc.msb (froma 12MB MobileSheetsProBackup.msb) and the message/output
C:\Perl64\bin>msb_reloc.pl --src=/storage/sdcard1/ --dst=/storage/6630-6438/ Mob
ileSheetsProBackup.msb
Reading MobileSheetsPro backup set version 4
Preferences: 31 items
C:\Users\BRX\AppData\Local\Temp\lhSRGO4kfg at C:\Perl64\bin\msb_reloc.pl line 35
2.
and stuck there.
When I run the script without parameters it prompts the missing files and writes a slightly smaller (but still 12 MB) MobileSheetsProBackup_reloc.msb
What's wrong?
Posts: 1,234
Threads: 194
Joined: May 2015
Reputation:
13
03-15-2016, 08:27 AM
(This post was last modified: 03-15-2016, 08:48 AM by sciurius.)
Can you supply a "--debug" and "--ident" option and see if it says anything useful?
When you run without src/dst options, MobileSheetsProBackup_reloc.msb should be byto-for-byte identical to the original MobileSheetsProBackup.msb.
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Posts: 1,049
Threads: 112
Joined: Dec 2015
Reputation:
12
>When you run without src/dst options, MobileSheetsProBackup_reloc.msb should be byto-for-byte identical to the original MobileSheetsProBackup.msb.
I guessed that but it didn't. That's why I mentioned it.
>Can you supply a "--debug" and "--ident" option and see if it says anything useful?
I don't know if it's useful. It provided that:
E:\PortableApps\DropboxPortableAHK\Dropbox\MSBackup>msb_reloc.pl --src=/storage/
sdcard1/ --dst=/storage/6630-6438/ --debug --ident MobileSheetsProBackup.msb
This is MSProTools [msb_reloc 0.01]
Reading MobileSheetsPro backup set version 4
Preferences: 31 items
Pref item: default.xml
item: <?xml version='1.0' ...
Pref item: display_settings.xml
item: <?xml version='1.0' ...
Pref item: pedal_actions.xml
item: <?xml version='1.0' ...
Pref item: tap_actions.xml
item: <?xml version='1.0' ...
Pref item: tab_states.xml
item: <?xml version='1.0' ...
Pref item: import_settings.xml
item: <?xml version='1.0' ...
Pref item: crop_activity_settings.xml
item: <?xml version='1.0' ...
Pref item: connection_settings.xml
item: <?xml version='1.0' ...
Pref item: annotation_settings.xml
item: <?xml version='1.0' ...
Pref item: annotation_settings_pen.xml
item: <?xml version='1.0' ...
Pref item: annotation_settings_highlight.xml
item: <?xml version='1.0' ...
Pref item: annotation_settings_toolbar.xml
item: <?xml version='1.0' ...
Pref item: annotation_settings_list.xml
item: <?xml version='1.0' ...
Pref item: annotation_settings_stamp.xml
item: <?xml version='1.0' ...
Pref item: annotation_settings_nudge.xml
item: <?xml version='1.0' ...
Pref item: annotation_settings_text.xml
item: <?xml version='1.0' ...
Pref item: stamp_scales.xml
item: <?xml version='1.0' ...
Pref item: media_player_settings.xml
item: <?xml version='1.0' ...
Pref item: import_settings.xml
item: <?xml version='1.0' ...
Pref item: swap_dialog.xml
item: <?xml version='1.0' ...
Pref item: song_editor_settings.xml
item: <?xml version='1.0' ...
Pref item: ms_bookmarks.xml
item: <?xml version='1.0' ...
Pref item: metronome_settings.xml
item: <?xml version='1.0' ...
Pref item: next_song_prefs.xml
item: <?xml version='1.0' ...
Pref item: editor_fields.xml
item: <?xml version='1.0' ...
Pref item: group_editor.xml
item: <?xml version='1.0' ...
Pref item: text_display_settings.xml
item: <?xml version='1.0' ...
Pref item: export_settings.xml
item: <?xml version='1.0' ...
Pref item: share_settings.xml
item: <?xml version='1.0' ...
Pref item: write_ann_settings.xml
item: <?xml version='1.0' ...
Pref item: snippet_settings.xml
item: <?xml version='1.0' ...
Database length = 12038144
C:\Users\BRX\AppData\Local\Temp\3xcvHFuUx7 at E:\PortableApps\DropboxPortableAHK
\Dropbox\MSBackup\msb_reloc.pl line 352.
Posts: 1,234
Threads: 194
Joined: May 2015
Reputation:
13
I assumed you would fetch a new version from github first...
Can you fetch the new version, rerun the tool with the debug and ident options, and send the output via email?
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Posts: 1,049
Threads: 112
Joined: Dec 2015
Reputation:
12
Mike, I can happily report that Sciurius provided a Perl script that successfully replaced the paths directly in the db.
It wasn't necessary to work with a backup as we first tried. So you don't need to be in a hurry with your adjustments. Thanks for your help so far, too.
And the load times seem to be much quicker now as well. No idea if this is because of Marshmallow or the relocated database.
(I guess you'll have to address the problem with writing backups to the SD card though that -again - comes with the upgrade)
|