Skip to content

downgrade DB from v1.4.x to v1.3.x (and v1.5.0) #2353

Description

@vomikan

Solution:

  1. extract this zip-file to any folder.
    downgrade_db_13_7_v4.zip

  2. Run mmex 1.3.x / 1.5.x and open your DB
    image

image
choose Yes
4) choose previously extracted downgrade_db_13_7_v4.mmdbg file
image
5) Close the app
6) Run the app and choose your DB file. It's already downgraded.
Happy end

--------------------------------8<-----------------------------------------------------
I have been on 1.4 alpha7 for ages and don't see any active developement on that.
I see 1.3.4 release round the corner. Can you just open up the 1.4 alpha7 file with 1.3.4 please?

image

MMEX version:

  • 1.4.x
  • 1.3.x
  • 1.2.x
  • 1.1 or older

Activity

  1. vomikan commented on Apr 2, 2020

    @vomikan
    MemberAuthor

    I was expecting this question. It need to develop a script to restore compatibility.

    Yes, development 1.4.0 is suspended. Many new features were added, but there were not enough resources to support the development.
    Version 1.3.4 contains many of the fixes from 1.4.0, but the database remains at version 7, like the most popular version 1.3.3.

  2. self-assigned this
    on Apr 2, 2020
  3. reddyshyam commented on Apr 2, 2020

    @reddyshyam

    Thanks @vomikan for the prompt reply and this new ticket. I will keep an eye on this one and downgrade to 1.3.4

    Really appreciate all your selfless efforts. 🤝 🙇 👏 🤗

  4. vomikan commented on Apr 2, 2020

    @vomikan
    MemberAuthor

    Seems it's just a patch needed. When the "MMEX database upgrade" warning were closed the following dialog appears:

    image

    I believe a proper prepared patch can downgrade DB.

  5. reddyshyam commented on Apr 2, 2020

    @reddyshyam

    Hi @vomikan,

    I can definitely help. Please let me have the patch. Will let you know how it goes.

  6. vomikan commented on Apr 2, 2020

    @vomikan
    MemberAuthor

    Required script would complex.
    The following script does upgrade DB.
    https://github.com/moneymanagerex/database/blob/master/incremental_upgrade/database_version_12.sql

    To downgrade DB it should be the script like the provide by the link above but with reverse logic.
    For example (fragment of a possible patch):

    CREATE TABLE IF NOT EXISTS ACCOUNTLIST_V1
            (ACCOUNTID integer primary key
            , ACCOUNTNAME TEXT COLLATE NOCASE NOT NULL UNIQUE
            , ACCOUNTTYPE TEXT NOT NULL 
            , ACCOUNTNUM TEXT
            , STATUS TEXT NOT NULL /* Open, Closed */
            , NOTES TEXT, HELDAT TEXT
            , WEBSITE TEXT
            , CONTACTINFO TEXT
            , ACCESSINFO TEXT
            , INITIALBAL numeric
            , FAVORITEACCT TEXT NOT NULL
            , CURRENCYID integer NOT NULL
            , STATEMENTLOCKED integer
            , STATEMENTDATE TEXT
            , MINIMUMBALANCE numeric
            , CREDITLIMIT numeric
            , INTERESTRATE numeric
            , PAYMENTDUEDATE text
            , MINIMUMPAYMENT numeric
    );
    
    INSERT INTO ACCOUNTLIST_V1
    SELECT
    ACCOUNTID
    , ACCOUNTNAME
    , case when ACCOUNTTYPE in ('Cash','Checking','Credit Card','Loan','Term','Investment','Asset','Shares') then ACCOUNTTYPE else 'Cash' end ACCOUNTTYPE 
    , ACCOUNTNUM
    , STATUS
    , NOTES 
    , HELDAT
    , WEBSITE
    , CONTACTINFO
    , ACCESSINFO
    , INITIALBAL
    , FAVORITEACCT
    , CURRENCYID
    , STATEMENTLOCKED
    , STATEMENTDATE
    , MINIMUMBALANCE
    , CREDITLIMIT
    , INTERESTRATE
    , PAYMENTDUEDATE
    , MINIMUMPAYMENT
    FROM ACCOUNTLIST;
    
    DROP TABLE ACCOUNTLIST;
    --etc for all tables
    .......
    -- finish
    PRAGMA user_version = 7;
    
  7. reddyshyam commented on Apr 2, 2020

    @reddyshyam

    Hi @vomikan.

    Please see if the attached helps. If you confirm, then we can test patching.

    database_version_7.zip

  8. vomikan commented on Apr 2, 2020

    @vomikan
    MemberAuthor
    1.3.4 1.4.0
    image image
    , case when ACCOUNTTYPE != 'Crypto' then ACCOUNTTYPE else 'Cash' end ACCOUNTTYPE 
    
  9. reddyshyam commented on Apr 2, 2020

    @reddyshyam

    , case when ACCOUNTTYPE != 'Crypto' then ACCOUNTTYPE else 'Cash' end ACCOUNTTYPE
    Hi @vomikan,

    Hope you are just documenting the corrections. I have done the changes my end in the above sql.

  10. vomikan commented on Apr 2, 2020

    @vomikan
    MemberAuthor

    CREATE TABLE IF NOT EXISTS ASSETS_V1( ..
    then not needed
    CREATE TABLE ASSETS_V1( ..

    PS Good job! Just delete not needed CREATE TABLE xxx

  11. vomikan commented on Apr 2, 2020

    @vomikan
    MemberAuthor

    it would not work. May be deleted.

    -- rename table names used in GRM definitions
    
    UPDATE REPORT SET SQLCONTENT = CONCAT(SQLCONTENT,'_V1') WHERE SQLCONTENT NOT LIKE  '%_V1%' COLLATE NOCASE;
    UPDATE REPORT SET LUACONTENT = CONCAT(LUACONTENT,'_V1') WHERE LUACONTENT NOT LIKE '%_V1%' COLLATE NOCASE;
    UPDATE REPORT SET TEMPLATECONTENT = CONCAT(TEMPLATECONTENT, '_V1') WHERE TEMPLATECONTENT NOT LIKE '%_V1%' COLLATE NOCASE;
    
  12. vomikan commented on Apr 2, 2020

    @vomikan
    MemberAuthor

    Finally, all unused tables should be dropped.

    DROP TABLE ASSETCLASS;
    .....
    DROP TABLE SHAREINFO;
    -- finish
    PRAGMA user_version = 7;
    
  13. 36 remaining items

  14. tosim91 commented on May 6, 2021

    @tosim91

    I now have the debug file file, but, am totally lost re how to use it. Sure would just prefer the 1.40deb file. Thank you.

  15. whalley commented on May 6, 2021

    @whalley
    Member

    Follow the steps here: #2353

    You can ignore step 1 if you have the debug file

  16. added this to the v1.6.0 milestone on May 7, 2021
  17. jeepcook commented on Jul 29, 2021

    @jeepcook

    Hello,
    I have a database v7. I think I have to upgrade to V13 but I don't know how to do that. Is there an online method, or anybody here can convert it?
    Thanks

  18. whalley commented on Jul 29, 2021

    @whalley
    Member

    @jeepcook - Why do you think you need to upgrade to v13. All the latest MMEX releases (e.g. v1.5.4) run on the v7 database. The v13 database was only applicable to the v1.4.x branch which is now obsolete.

    So if you are using the latest MMEX releases with the v7 DB that is fine.

  19. jeepcook commented on Jul 29, 2021

    @jeepcook

    @jeepcook - Why do you think you need to upgrade to v13. All the latest MMEX releases (e.g. v1.5.4) run on the v7 database. The v13 database was only applicable to the v1.4.x branch which is now obsolete.

    So if you are using the latest MMEX releases with the v7 DB that is fine.

    Ok thanks, I didn't understand that !!

    With the android version, I have errors when I chek the Bdd:
    missing tables:
    SPLITTRANSACTIONS_V2
    SETTINGS_V1
    USAGE_V1

    The app works great so I don't know if I have to fix that?

    Thanks

  20. whalley commented on Jul 29, 2021

    @whalley
    Member

    OK, if you have Android app related issues then please raise them here: https://github.com/moneymanagerex/android-money-manager-ex/issues

  21. jeepcook commented on Jul 29, 2021

    @jeepcook

    In fact, I use both android and pc version. If I have a bdd error on android, I have the same on pc version I think.

  22. whalley commented on Jul 29, 2021

    @whalley
    Member
  23. jeepcook commented on Jul 29, 2021

    @jeepcook

    Here is the screenshot
    Screenshot_2021-07-29-12-33-43-779_com money manager ex

  24. whalley commented on Jul 29, 2021

    @whalley
    Member

    OK, got it. It's French for Database/Datastore....

    Looks as if the tables_v1.sql file with the database definitions includes these tables but they are never used in the code anyway.

    You can ignore the warning, but probably worth raising an issue with the Android application maintainers to have the offending entries removed. https://github.com/moneymanagerex/android-money-manager-ex/issues

  25. removed this from the v1.7.0 milestone on Oct 21, 2022
  26. whalley commented on Oct 21, 2022

    @whalley
    Member

    Closing this now.

  27. unpinned this issue on Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions