Upgrading an old database

MMEX4Desktop, incl. Windows, macOS, and Most Unix variants using the GTK+ toolkit

Moderator: Renato

parky
New User
Posts: 5
Joined: Mon Feb 29, 2016 5:56 pm
Are you a spam bot?: No

Upgrading an old database

Post by parky »

I am a long term user of MoneyManagerEx. I'm running with a database that was created back on 01/01/2010. Needless to say that gives me an issue with the latest release and encryption. Also trying out the iOS version the App crashes instantly which I currently put down to the age of my database.

The main issue would appear to be with the page size of the database being 1024. Using wxSQLite+ and

Code: Select all

PRAGMA page_size=4096;
VACUUM;
just gets me:

Code: Select all

Started transaction.
Error 1 in:
Vacuum;
1:SQL logic error[1]: cannot VACUUM from within a transaction.
so that suggestion does not work for me. Any suggestions?

I did wonder about exporting everything from the current database and importing it into a new one - but that has various issues. For example exporting using MMEX CSV files and importing using 'MMEX format' does not work out-of-the box as the export outputs just the category field (as category:subcategory) whilst the import template is looking for two separate fields ...category,sub-category,...

In my preliminary experiments I ended up exporting/importing accounts individually although there is the option of exporting them all together. If I do that it looks like I have a problem when importing as I'm asked to create an account to import them all into - it apparently can't separate the accounts when importing. What have I missed there?

Also import/export seems to be just for the accounts. Is there anyway of transferring the "Scheduled transactions" data?

Any comments/pointers welcome especially from those with deeper knowledge of the app - I just use it for keeping track of the ins and outs of my various accounts for which it's being doing an excellent job for the last 20(?) years.
User avatar
Renato
MVP User
Posts: 866
Joined: Mon Apr 25, 2011 7:36 pm
Are you a spam bot?: No
Location: near Zurich

Re: Upgrading an old database

Post by Renato »

It would of course be very helpful for us if you could tell us which version of MMEX you have been working with and which version is now causing the problem.

You can find information on this topic here: https://github.com/moneymanagerex/money ... ssues/6971
Renato Forum Administrator (I'm not a developer)
parky
New User
Posts: 5
Joined: Mon Feb 29, 2016 5:56 pm
Are you a spam bot?: No

Re: Upgrading an old database

Post by parky »

Apologies. Windows 1.8.1 64-bit. I tend to upgrade as each new version is released.
User avatar
Renato
MVP User
Posts: 866
Joined: Mon Apr 25, 2011 7:36 pm
Are you a spam bot?: No
Location: near Zurich

Re: Upgrading an old database

Post by Renato »

Renato Forum Administrator (I'm not a developer)
parky
New User
Posts: 5
Joined: Mon Feb 29, 2016 5:56 pm
Are you a spam bot?: No

Re: Upgrading an old database

Post by parky »

I'm sorry I didn't make myself clear at the start - MMEX is running fine for me and I have no issue other than I can no longer use an encrypted database file with the latest version. As I understand it this is due to my (years old) database file being created with a page size of 1024 whilst MMEX now requires the page size to be 4096 if you are using encryption.

The suggested approach to change/update the database file using wxSQLite+ does nothing for me other produce an error message. Have I misread the instructions? I think that unlikely but there maybe some fundamental assumptions that the author didn't bother to include....

My (naive?) thought of taking an alternative approach of exporting all my data in CSV format and then importing it into a fresh database turned out not be as simple as I hoped.

I'm looking for a simple way forward - if there is one.
User avatar
Renato
MVP User
Posts: 866
Joined: Mon Apr 25, 2011 7:36 pm
Are you a spam bot?: No
Location: near Zurich

Re: Upgrading an old database

Post by Renato »

Have you tried the new beta version?
Renato Forum Administrator (I'm not a developer)
parky
New User
Posts: 5
Joined: Mon Feb 29, 2016 5:56 pm
Are you a spam bot?: No

Re: Upgrading an old database

Post by parky »

[I did briefly try the beta but still couldn't save an encrypted database]

I've finally got this sorted with the wxSQLite+ approach.
1. Start wxSQLite+
2. Pick 'File Open/Create' and then select your database (testing.mmb in my case)
3. Type in the SQL commands top right:

Code: Select all

PRAGMA page_size=4096;
VACUUM main INTO 'path-to-file\testingX.mmb';
Note: Destination file must not exist or must be empty.
4. Pick drop-down menu 'transaction' and click on 'End transaction' if in bold.
5. Click on the green arrowhead (Execute SQL).
That should be it.

My issues I think were twofold:
(1) The system often had some 'transaction in progress' flagged (what? why?) when I tried to run the SQL. This resulted in an error message when VACUUM ran.
(2) The total lack of feedback if it ran successfully.

The latter I fixed by using VACUUM ... INTO .... which produces a new database file that shows that it's done what it is supposed to.