Instructions to Sync with Google Drive

MMEX4Android, https://play.google.com/store/apps/deta ... ex.android

Moderator: Renato

Post Reply
stpharm
Senior User
Posts: 21
Joined: Sat May 05, 2018 2:14 pm
Are you a spam bot?: No

Instructions to Sync with Google Drive

Post by stpharm »

This is a simple step by step guide to get flawless sync with Google Drive

1. I have set as a path for my Windows PC version of mmex a SHARED Folder (i need to have a common db with my wife) within Google Drive .eg ....\Google Drive\_SHARED FOLDER\mmEX\mmEx.mmb
2. On Android phone navigate through the Google Drive app and find the Database : mmEx.mmb
3. Set it so it is available OFFLINE
4. Run the MMEX app on your phone , Through the main manu Choose Open Database - Other - Open From Drive - Choose the folder with the mmEx.mmb

5. NOW THE IMPORTANT STEP !!!
If you wish to enter transactions from ANDROID device you should ALWAYS perform STEP 4 , BEFORE you start entering transactions AND ALWAYS HIT SYNCHRONISE after you FINISH
6. Make Sure Google Drive has Unrestricted Data Access OR MAKE SURE That drive has finished Uploading updated mmEx.mmb on Cloud

If you stick to those steps you will never have problem with syncing
guanlisheng
Developer
Posts: 470
Joined: Wed Dec 21, 2011 5:58 am
Are you a spam bot?: No
Contact:

Re: Instructions to Sync with Google Drive

Post by guanlisheng »

@stpharm , this is great instruction. is there any video screen to demo the steps?
Lisheng Guan,
Developer of MoneyManagerEX (http://moneymanagerex.org)
User avatar
Renato
MVP User
Posts: 767
Joined: Mon Apr 25, 2011 7:36 pm
Are you a spam bot?: No
Location: near Zurich

Re: Instructions to Sync with Google Drive

Post by Renato »

Renato Forum Administrator
ParadigmShifter
New User
Posts: 6
Joined: Sun Nov 03, 2024 5:38 pm
Are you a spam bot?: No

Re: Instructions to Sync with Google Drive

Post by ParadigmShifter »

Hello,

I am having problems with the Google Drive sync. I tried following the procedure described here and in Github.

MoneyManagerEx on Android does not update the database. It says the database is up do date, but it is not.

Here is happening: I modified the Database today at 12h30 and today at 18h30 on Windows. The database is saved to Google Drive.

Both in Windows and on Android I made sure the file is available offline, and I made sure that the database in my Google Drive on Android was updated. It is, as it says that the file was modified at 18h30.

When I select to open the database in Android and select this file from 18h30, it says that "the database is already up to date", and continue showing me the data from my database of 12h30, even though this file does even exist anymore in my Google Drive as it was overwritten by the one of 18h30.

Synchronizing did not work.

The database file is not encrypted AFAIK (it is a .mmb file).

In Android I am using version 2024.10.19 (1042) from F-Droid, and in Windows this is from my "About" section of MMEX:

Code: Select all

Money Manager Ex
• Version: 1.8.0 64-bit
• Built on: Apr 29 2024 08:08:39
• Database version: 19 (aes128cbc)
• Git commit: 3325705 (2024-04-29)
MMEX is using the following support products:
• wxWidgets 3.2.4 (wxMSW 10.0)
• wxSQLite3 4.9.1 (SQLite 3.40.0)
• RapidJSON 1.1.0
• Lua 5.3.5
• libcurl/8.5.0-DEV Schannel
• gettext 0.21
• apexcharts.js
Built with:
• CMake 3.29.1
• MSBuild 17.9.8.16306
• Microsoft Visual Studio 17.0
• Microsoft Visual C++ 19.39.33523.0
• Windows SDK 10.0.22621.0
Running on:
• Windows 11 (build 22621), 64-bit edition
• System Locale: 
• User Interface Language: en_US.windows-1252
• 1920x1080 32-bit 96x96ppi
I would kindly ask if there are any suggestions to solve this problem.

Best regards,

Pedro
guanlisheng
Developer
Posts: 470
Joined: Wed Dec 21, 2011 5:58 am
Are you a spam bot?: No
Contact:

Re: Instructions to Sync with Google Drive

Post by guanlisheng »

Thanks @ParadigmShifter for trying MMEX. It seems the instructions are a little bit outdated, as being available offline is not necessary here. A simplified guideline would be found here

can you share synchronization via `三 -> Settings -> Synchronization`? and try `三 -> synchronize` to perform manual syncs.
ParadigmShifter
New User
Posts: 6
Joined: Sun Nov 03, 2024 5:38 pm
Are you a spam bot?: No

Re: Instructions to Sync with Google Drive

Post by ParadigmShifter »

Hey @guanlisheng, thank you for your fast response.

I send attached two screenshots of my Settings on my Android phone, one of the Synchronization and the other of the Database.

Additional information:
  • * I tried manual synchronization, as you suggested, but it did not work. I always get the message that the 'database is up to date' even though it is not
    * In Synchronization, I tapped in the "Download" button. It said 'copied X bytes' but it did not change anything, database still not up to date after
    * When I tap on "Download" in the Database section, I get a message :"Download Warning - Local file changes indicator:false. Downloading will overwrite your local version. Do you want to continue?".
    * In "Database", I tapped both "Check db integrity" and "Check db schema". No problems were found, I got the messages "The database passed the integrity test succesfully" and "All the required tables are present in the database".
    * I got a fingerprint when I try to open the database from scratch, I got an empty message saying "Authentication help: <blank line>"
UPDATE: I managed to get it working, somehow. I had set up a Passcode in the app, and I disabled it. Somehow I got to sync. The passcode was a bit buggy though, I had the impression that even wehn I disabled it I was still being asked for it. When I closed and reopened the app this did not happen.

UPDATE 2: Ok so... It is not working. I tried creating a dummy transaction on Windows just to check. Uploaded the database to Google Drive. Google Drive on Android sees that the file has been updated. When I try to open the database or synchronize it manually, it does not refresh. I thought that waiting for the synchronization interval (in my case 5 minutes) could make it work, but it could not.

The problem is, the working of the synchronization seems very casual. I cannot seem to understand why it worked on the two times it did previously.

Thanks for the attention!
Attachments
photo_4989994026874810298_y.jpg
photo_4989994026874810298_y.jpg (12.88 KiB) Viewed 1477 times
photo_4989994026874810298_y.png
photo_4989994026874810298_y.png (41.36 KiB) Viewed 1477 times
guanlisheng
Developer
Posts: 470
Joined: Wed Dec 21, 2011 5:58 am
Are you a spam bot?: No
Contact:

Re: Instructions to Sync with Google Drive

Post by guanlisheng »

Thanks and these detailed settings and steps are sufficient.

Maybe you can try removing the offline setting from Google Drive on Android. This might be a cause as MMEX always talks with it to get the latest metadata and data (if the local copy is outdated).

as the reason might be the communication between MMEX and Google Drive on Android, can you share your Google Drive version?
ParadigmShifter
New User
Posts: 6
Joined: Sun Nov 03, 2024 5:38 pm
Are you a spam bot?: No

Re: Instructions to Sync with Google Drive

Post by ParadigmShifter »

ParadigmShifter wrote: Mon Nov 04, 2024 10:09 am Hey @guanlisheng, thank you for your fast response.

I send attached two screenshots of my Settings on my Android phone, one of the Synchronization and the other of the Database.

Additional information:
  • * I tried manual synchronization, as you suggested, but it did not work. I always get the message that the 'database is up to date' even though it is not
    * In Synchronization, I tapped in the "Download" button. It said 'copied X bytes' but it did not change anything, database still not up to date after
    * When I tap on "Download" in the Database section, I get a message :"Download Warning - Local file changes indicator:false. Downloading will overwrite your local version. Do you want to continue?".
    * In "Database", I tapped both "Check db integrity" and "Check db schema". No problems were found, I got the messages "The database passed the integrity test succesfully" and "All the required tables are present in the database".
    * I got a fingerprint when I try to open the database from scratch, I got an empty message saying "Authentication help: <blank line>"
UPDATE: I managed to get it working, somehow. I had set up a Passcode in the app, and I disabled it. Somehow I got to sync. The passcode was a bit buggy though, I had the impression that even wehn I disabled it I was still being asked for it. When I closed and reopened the app this did not happen.

UPDATE 2: Ok so... It is not working. I tried creating a dummy transaction on Windows just to check. Uploaded the database to Google Drive. Google Drive on Android sees that the file has been updated. When I try to open the database or synchronize it manually, it does not refresh. I thought that waiting for the synchronization interval (in my case 5 minutes) could make it work, but it could not.

The problem is, the working of the synchronization seems very casual. I cannot seem to understand why it worked on the two times it did previously.

Thanks for the attention!
UPDATE: I uninstalled and reinstalled MMEX on Android from F-Droid, to get a fresh start. I am able to sync from Windows to Android.

HOWEVER, I cannot get Android to Windows work. If I enter a transaction in Android, hit Synchronize, upload to Google Drive, on Windows I can see changes in my Google Drive, but if I open this database with MMEX I still get the old database. It is the same problem I had with Android, but inverse, now Android can see what Windows does, but Windows cannot see what Android does.

Moreover, I noticed that I get some BAK files with like this : "<Database name>.mmb_update_YYYY-MM-DD.bak" where YYYY MM DD are the year, month and date of the update. I could not see in which occasions they were generated. They have the same file size as the .mmb database, and they do not seem to be deleted automatically. Is that normal? Should I manually delete these files?
ParadigmShifter
New User
Posts: 6
Joined: Sun Nov 03, 2024 5:38 pm
Are you a spam bot?: No

Re: Instructions to Sync with Google Drive

Post by ParadigmShifter »

guanlisheng wrote: Mon Nov 04, 2024 10:48 am Thanks and these detailed settings and steps are sufficient.

Maybe you can try removing the offline setting from Google Drive on Android. This might be a cause as MMEX always talks with it to get the latest metadata and data (if the local copy is outdated).

as the reason might be the communication between MMEX and Google Drive on Android, can you share your Google Drive version?
Sorry, I hadn't seen your reply, thank you again.

My Google Drive version is 2.24.427.5.all.alldpi (Android) and 99.0.0.0 (Windows)

Okay, so, I think I had already changed it, because it was already marked as online-only on Android.

On Windows it was marked as available offline, but I changed it to online only.

Same thing is happening as in my previous post now: Google Drive see changes from both sides, but now only Android sees Windows changes, Windows does not see Android changes. Making the file online-only in Windows did not change anything it seems.

I don't know if this is the place to ask these questions, but I will leave them here:
  1. What is the difference between "Synchronizing" and "Upload/Download" (on Android)?
  2. Can I keep my MMEX clients both on Windows AND Android while making changes? I've been doing so, as I thought changes were fetched automatically, but still, just to be sure
  3. What about the .bak files, what are they? For now I have a small database (.mmb) but it grows in time it would be a shame to have another file with the same size that serves no purpose (as I can see) and that I have to get rid off manually
Last edited by ParadigmShifter on Mon Nov 04, 2024 5:19 pm, edited 1 time in total.
User avatar
Renato
MVP User
Posts: 767
Joined: Mon Apr 25, 2011 7:36 pm
Are you a spam bot?: No
Location: near Zurich

Re: Instructions to Sync with Google Drive

Post by Renato »

What about the .bak files, what are they? For now I have a small database (.mmb) but it grows in time it would be a shame to have another file with the same size that serves no purpose (as I can see) and that I have to get rid off manually
viewtopic.php?p=24996&hilit=backup#p24996
Renato Forum Administrator
guanlisheng
Developer
Posts: 470
Joined: Wed Dec 21, 2011 5:58 am
Are you a spam bot?: No
Contact:

Re: Instructions to Sync with Google Drive

Post by guanlisheng »

Thanks for sharing google drive client information

1. Sync is bi-directional while upload/download is force and single directional as self-explanatory.
2. It is synced/fetched periodically instead.

Actually sync is a plugin instead of built-in function as one key is to 100% control your data locally. One recommended setup is device storage + whatever your preferred synching tool
ParadigmShifter
New User
Posts: 6
Joined: Sun Nov 03, 2024 5:38 pm
Are you a spam bot?: No

Re: Instructions to Sync with Google Drive

Post by ParadigmShifter »

Answering my own question: I finally understood how to sync bidirectionally between Android and Windows via Google Drive.

Observations and comments:
  • DO NOT leave MMEX open at the same time on Windows and on Android. Leave only one instance of it open at a time
  • DO NOT use "Synchronize"
Here is the step by step that I used.

From Windows to Android:
  1. Make sure MMEX in Android is NOT running
  2. Make the desired operations in MMEX file in Windows. Then, close MMEX when finished. MMEX will then proceed to update the database in Google Drive. Wait for the upload to be complete
  3. After the upload is complete, open the Google Drive in Android and download the changes
  4. After fetching the changes in the Google Drive app on Android, open MMEX on Android. The database should be updated with the latest changes without the need to do anything else!
From Android to Windows:
  1. Make sure MMEX in Windows is NOT running
  2. Make the desired operations in MMEX in Android. Then, go to "Settings -> Synchronization -> Upload". Wait for the upload to be
    complete.
  3. After the upload is complete, open the Google Drive app on Android and fetch the changes.
  4. On Windows, make sure that the changes have been fetched by Google Drive.
  5. Open MMEX, choose "Open Existing Database" (even if the last opened database was the one you were using). The database should be updated with the latest changes without the need to do anything else!
I know that this method is cumbersome, but after two days fighting with the synchronization this finally seems to work.
frankieorabona
Senior User
Posts: 35
Joined: Sat Mar 21, 2015 9:15 am
Are you a spam bot?: No
Location: Italia

Re: Instructions to Sync with Google Drive

Post by frankieorabona »

@ParadigmShifter I confirm that with this method you are able to have smooth file synchronization.

I think obviously not having the two programs open at the same time was a priority since I don't think the MMEX program can, via google drive, merge the real-time changes made by either side.

However, compared to your guide I had to disable synchronization at startup in the android app because at startup, the program would always crash. I was forced to restart the phone to get MMEX ANDROID working again.
Post Reply