Backup Data and Dump Data ... ? Which one ?

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Backup Data and Dump Data ... ? Which one ?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:21 pm

by robert >> Sun, 27 Jul 2008 13:19:06 GMT

Dear Jade User

I have some simple questions

1.
What is the difference between BACK UP Database and DUMP Database in JADE ?

2.
What kind of Information is Backed Up in BACK UP Database ?
( the data is included or not ? --
I tried to BACK UP my database ... and when I back restore .. I did not get my data :-(
Do I lose some steps during backup ? )

3.
then ...
in which scenario we do BACK UP and -- or DUMP Database ?

thanks for your sharing information

robert

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Backup Data and Dump Data ... ? Which one ?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:21 pm

by Dean Cooper >> Sun, 27 Jul 2008 19:49:54 GMT

The Dump/Load Utility is used mainly to transfer your user data from one version of JADE to another where direct file copying isn't appropriate or possible. For example, when transferring data between different OS platforms (eg: JADE Windows and JADE Linux), or between ANSI and Unicode systems, or when you want a platform-independent format for your initial system data instead of copying user data files. The Dump/Load Utility generally isn't used for database backups.

JADE's backup facilities can be used to backup a whole database (including both system specifications and user data) or a selection of files, in both online and offline modes. Please refer to Chapter 2 in the DbAdmin.pdf manual for an overview of Backups. The mechanism outlined in "Backing Up Your JADE Development Environment" is a quick way of taking a backup of all of the files (both system/meta data and user data) in your development system. Alternatively, you can use the File | Open Database and then Operation | Backup Database menu items from the Database Utility (jdbutil.exe), which will also backup all files by default (see "Using the Backup Database Command" in Chapter 1 of DbAdmin.pdf).

If you want to build backup facilities into your own applications, then please refer to "Using the Database Administration Framework" in Chapter 10 of the DevRef.pdf manual.

Dean.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Backup Data and Dump Data ... ? Which one ?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:21 pm

by Patwos >> Sun, 27 Jul 2008 21:21:24 GMT

Further to Dean's reply, the Dump/Load utility has been somewhat superseded by the more recent JadeConvertDb application. This is a much faster way of converting your Jade system between Windows/Linux or between Ansi/Unicode on Windows.

For further details see:

JADE Runtime Application Guide (RuntimeApps.pdf)
Chapter 4: Converting a User Database

Hope that helps,
Pat.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Backup Data and Dump Data ... ? Which one ?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:21 pm

by robert >> Wed, 6 Aug 2008 19:57:14 GMT

Hallo Dean

Thanks for your information

then ... I still have open question.

1.
How to back up persistent data ?
( see example from BankModelSchema )

Example
createChequeAccounts();

vars
chequeAcc : ChequeAccount;
begin
beginTransaction;
create chequeAcc persistent;
chequeAcc.setPropertiesOnCreate(100, 5000);
create chequeAcc persistent;
chequeAcc.setPropertiesOnCreate(650, 2000);
commitTransaction;
end;

Code above is create 2 persistent data for ChequeAccount.
I do a back up.
but after I restore, I can not get any persistent data.
( in this case, i get back my data from dump file that I created before )


2.
As your answer,
(including both system specifications and user data)
What is the meaning of User Data here - is this Persistent Data ?


Thanks
robert

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Backup Data and Dump Data ... ? Which one ?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:21 pm

by Dean Cooper >> Wed, 6 Aug 2008 23:33:39 GMT

Yes, by "user data" I mean your application's persistent data. The JADE database contains several types of file. All files starting with an underscore are JADE system files. The _sys*.bin and _jade*.bin files (located in the bin directory by default in JADE 6.2) are read-only system files that contain specifications for JADE itself (eg: the RootSchema, IDE, Monitor, etc). The _user*.dat files contain the specifications of your schemas (ie: applications). Other underscore files (eg: _environ.dat) are used by JADE when any applications are running. All other files (ie: non-underscore files) contain your persistent data.

The backup mechanisms I mentioned in the second paragraph of my previous reply *do* backup your persistent user data files. We don't recommend that you use Dump/Load for backups.

Dean.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Backup Data and Dump Data ... ? Which one ?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:21 pm

by Patwos >> Wed, 6 Aug 2008 23:46:26 GMT

There are two types of data that you as a developer create in any given Jade Database:

1. Meta Data. This is the data that describes your system. You do not "directly" create this, but rather when you use the Jade IDE to add a class, add a property to a class, add a method to a class, etc, the Jade IDE is creating instances of Class class, PropertyRef class, JadeMethod class etc.

For example, the code in the IDE application when you click ok to add a property to a class is doing a beginTransaction, creating/updating instances of the appropriate "meta-data" classes, and then doing a commitTransaction. This meta-data that gets created when you're using the Jade IDE to define your classes, properties, methods etc is stored in the _user****.dat files in your system directory.

2. User Data. This is the data that is created when your application, such as the banking application, does a beginTransaction, creates/updates instances of the appropriate classes, and then does a commitTransaction. This data is stored into the .dat files that you defined for the relevant classes.

When you run a full backup of the Jade Database, using jdbutil.exe or the Backup Database option in the Jade Admin section of the IDE, or via your own logic to utilise the JadeDatabaseAdmin class you are backing up all your own defined .dat files and all the _user***.dat files as well as any ancilliary files required such as _control.dat etc. When such a full backup is restored you get back both the meta-data that describes your application and the user data that you had created prior to performing the backup.

How are you performing your backup and restore processing, what options are you selecting when backing up and restoring, and how are you determining that none of your persistent user data is being corretly restored?

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Backup Data and Dump Data ... ? Which one ?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:21 pm

by robert >> Fri, 8 Aug 2008 7:52:03 GMT

Dear Patwos and Dean Cooper


Thanks for your answers

I try to follow your answers for Erewhon example.
I can back up and restore persistent data.
Everything is good and clear ............................................................................ .................
I create very simple code ( in attachment )
I execute createPerson code,
I back up the data then I restore.
but unfortunately I can not my data back. :-(

please show if I miss some steps.
( note : for back up and restore ... I used Jade Database Utility with all default setting )

thanks
robert
Attachments
5355.rar
(2.26 KiB) Downloaded 75 times
Last edited by ConvertFromOldNGs on Fri Aug 07, 2009 4:28 pm, edited 1 time in total.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Backup Data and Dump Data ... ? Which one ?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:21 pm

by Dean Cooper >> Fri, 8 Aug 2008 11:08:40 GMT

How are you checking that your data has not been restored after the backup?

After you have done the backup restore, is there a "Testing.dat" file in your database (ie: "system") directory?

Once you have restored the system, bring up JADE and execute the following line of code from a JadeScript method or Workspace window in your Testing schema:

write Person.instances.size;

If that writes out non-zero, then it means that your Person objects (ie: persistent user data) has been restored by the backup.

You could then try this line of code:

Person.instances.inspectModal;

to bring up an Inspector window that will let you look at your Person objects. If you can see some objects then you know that the backup has restored your data.

Your code is create 100 Person objects each time it is run, but they are not being gathered up (ie: collected) anywhere in a collection for you to access later. That's why the two lines of code above are using the Class::instances method to access them, which isn't recommended in production applications. Generally you will have a single top-level "root" object (that you retrieve with Class:: firstInstance when your application starts) that holds references and collections by which you access other objects in your system.

In the Erewhon system, the Company class is used for this purpose. Have a look at Part 3 in Erewhon.pdf - you will see that Company appears in all of the diagrams and has collections (the "all" properties) of the other objects in the system. In the ErewhonInvestmentsModelSchema, look at the references (right click, References) for the ErewhonInvestmentsModelApp::myCompany property to see how this root object is used.

Dean.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Backup Data and Dump Data ... ? Which one ?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:21 pm

by robert >> Fri, 8 Aug 2008 12:53:34 GMT

Dear Dean Cooper

After some investigate step by step.
I found the problem.

as you wrote to me .....

after restore ... I can not find Testing.dat ( the only one file that missing ) in jade62\system


how it could be happen ?

thanks
robert

Note
I run also in another PC with no result. and how about in your PC ?

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Backup Data and Dump Data ... ? Which one ?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:21 pm

by Dean Cooper >> Fri, 8 Aug 2008 13:26:14 GMT

I've just done all of the following steps using JADE 6.2.15 with a Free Developer License, and my user data files were restored.

1. Make sure the system you want to backup has been shut down cleanly.

2. Run jdbutil.exe

3. Select File | Open

4. Enter or browse to the database (ie: "system" directory) that you want to backup

5. Select Operation | Backup Database

6. Enter or browse to a directory where you want the backup files to be written

7. Click OK to do the backup.

You'll get a bunch of messages written to the Database Utility's main window as the files are backed up. One of these should be for "Testing.dat". If it's not, check that "Testing.dat" actually exists in your "system" directory before you start the backup. When the backup is complete, you should see "Testing.dat" in your backup directory.

8. Select File | Close

9. Use Windows Explorer to create a new empty directory somewhere to restore into.

10. Select Operation | Restore Database | Restore With No Recovery

11. In the Database Path, enter or browse to the new directory you created in step 9.

12. Select the Directory Name option button, and enter or browse to your backup directory from step 6.

13. Click OK to restore the backup.

14. Select File | Exit to shut down the Database Utility.

If you follow the above steps and your "Testing.dat" file is still not restored and you've checked that "Testing.dat" exists in your "system" directory before the backup, try this:

[a] Follow steps 1 to 4 above

Select Operation | Certify Files

[c] Does "Testing.dat" appear in the list of Database Files on the left? If not, then this is probably why it's not being backed up.

[d] If it does appear, select it and click the Add button to move it to the Selected Files on the right

[e] Click OK to certify the file

[f] Are there any errors reported in the Database Utility window?

Dean.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 32 guests

cron