Db Data Disappear - New Branch (built-in db)

0
I have a normal project in Mendix 10.6.1 using built-in database, nothing special. When I create a new branch, I don't do any changes in project, just press F5 (run the project) and open in the browser, this happens: Some of the data from database simply disappear - it is gone, deleted. To correct this, I have to reenter the data to the db. Some of the data are still in the database but the data are not being displayed e.g. in Data Views. To correct this, I have to open every Overview page (or create one if I don't have it for particular entity), click on every item (open NewEdit page) and Save. It would be interesting to know, if this is a bug (Mendix corrupting the HSQL db files or something) or if I should not count on db data when creating a new branch a make a db snapshot beforehand and import the db data afterwards somehow?
asked
1 answers
3

What is the local db?

The used HSQL db is just a local file in a sub-folder of your branch folder on your disk.

This folder is NOT synced with Teamserver. Which means that when you commit this is not transfert and shared. Thus when creating another branchline, this database is not included.

 

What is a snapshot?

Creating a snapshot is like creating a backup. This backup is a zip of the local folder containing the DB file and document folder. This snapshot is synced with teamserver. Shared with other team members. And part of the files which are used when you create a new branch.

 

When is the snapshot used?

The snapshot is only used, when you don not have a local db file for your local branch deployment.

When deploying a local branch the following happens

  1.  is there a local db file yet?
    • yes? > use it
    • no? > is there a data snapshot?
      • yes > use it > unzip the folder and add to the deployment folder
      • no > create a new empty db file

If you have already a local db, but you want to use the snapshot.

  1. Go to the deployment folder of your local project folder
  2. open the deployment folder
  3. delete the folder Data
  4. Run your project

 

What happened in your case?

multiple options

  1. You already have a local db file for your branchline. with data entered earlier
  2. You already have a local db file for your branchline. Which was based on a OLDER data snapshot of the mainline
  3. You didn't have a local db and the snapshot was used to restore the db file

 

In all cases; whatever you do on the mainline will not reflect on a branch line. Unless you create a new snapshot in the mainline. Create a new branch line or merge the main with the existing branchline.

 

And you can hack a bit

  1. Open the local folder of your main line
  2. Open the deployment folder
  3. Copy the data folder CTRL-C
  4. Open the local folder of your branch line
  5. Open the deployment folder
  6. Delete the Data folder
  7. Paste the data folder CTRL-V
answered