+1 vote
785 views
Hello. I have been trying to bring in a folder to openLCA through Database --> Restore database --> (navigate to the folder I need) --> Open. However, the problem I am having is that when I select "Open", I open the folder instead of bring the file onto my openLCA platform. The restore database command worked fine for non-file downloads. Thank you for your help.
in openLCA by (130 points)
by (113k points)
it is as if you say: I want to open a word document as a folder, how can I do this? A database is not a folder. The database files are organised in a folder but you need to have the database in zolca format to import or restore it. If you do not have this zolca file, but only the folder with files that form the database (so to say), then it is maybe possible to restore the database but no files should be missing etc.. Let me know if you need support here and if I understood your question correctly.

1 Answer

+1 vote
by (190 points)
edited by

OpenLCA isn't really designed to allow you to import folders/directories because those directories are configured as "Derby Database" structures. If you modify them in any way you risk corrupting the entire dataset and losing that data. 

For export of a database for instance creating a .zolca file is preferred. 

• Easy to handle and import

The other Option is to export a .Json-LD which is a Zip folder. 

• When importing a Json-LD you import as a zip folder. Don’t unzip it.

Lets say you have a situation where you were archiving old datasets like I was the other day. Without thinking, I just zipped them all into an archive folder and then 6 months later I need to go back and get at the data in one of those databases for a new project. 

Now I'm in the situation you describe. 

I've broken the link between the OpenLCA software and the database and there is no option in the software to re-establish that link. 

• I haven't modified the folder structure or data of the database I want to get at so it isn't corrupted.

• I just can’t directly link that folder back with OpenLCA.

OpenLCA won't automatically detect and show database folders added to the save directory. 

The workaround I found is this:

1. Create an "EMPTY" database with the name you desire in OpenLCA

2. Close OpenLCA

3. Navigate to the location of the new "EMPTY" database folder you just created

4. Open the folder to show the: _olca_ , log , seg() , tmp, etc. folders and files. 

5. Select everything in the "EMPTY" database folder and delete it. 

Now you have OpenLCA linked to a completely empty folder. 

6. In a new window navigate to the database you want to work on in file explorer and open it. 

7. Copy the contents of the database (those same _olca_ , log , seg() , tmp, etc. folders and files.) and paste them into the "EMPTY" database folder you just created. 

8. Open OpenLCA and open the "EMPTY" database you created that now has the data you want in it. 

• It may prompt you to update the database when you go to open it. If you have since updated software. I always click yes. 

There you go. you have imported your data the hard way by replacing the Derby Database file structure on an empty database. 

Next time it would be better to export a .Zolca file for everything you want to archive. 

Some of us learn the hard way. wink

by (13.5k points)
Nice solution. Note that a *.zolca file is also just a zip-file. You can just zip the content of a database folder and rename it so that it has the zolca extension (make sure that the zip does only contain the content of the database folder, not the folder itself). Or you copy the folder into the databases folder and add it in the databases.json file. Or, with the latest openLCA 2 version, you can just copy it to the databases folder and it should detect it.
...