Orientdb: Suggested method for upgrading OrientDB from one version to the next.

Created on 16 Oct 2015  路  22Comments  路  Source: orientechnologies/orientdb

What is the best protocol for upgrading from one version of OrientDB to a newer version? In particular, does one usually just copy the old database folder into the new OrientDB folder? Or do people usually just store the database elsewhere and symlink to it? It just seems like copying the database will get difficult when it gets really large.

question

Most helpful comment

All 22 comments

Best solution for me is db in /home/orientdb/databases and insert entry server.database.path to properties in configuration file orientdb-server-config.xml:


So you don't have to copy db every time :-)

Thanks @janjilek , that makes more sense than copying it. Do you happen to remember which line(s) you changed in: orientdb-server-config.xml? And is that the only place you have to change that path? Any other security implications that I should also consider when moving that database folder?

I've been looking at the best approach, but so far, all seems too cumbersome.

If you drop the databases folder in /var/lib/orient, for example, and the config folder in /etc/orient, it seems that you have to modify at least one line in several files in the /opt/orientdb/bin folder.

Those files includes at a minimum backup.sh, server.sh, and console.sh

So with each upgrade, all those files will have to be modified again. We need a better approach. Perhaps an upgrade.sh script?

This is related to issue 4422 and issue 5130.

Thanks for the links to the other issues @finid . I tried searching for previous questions like this but didn't see anything.

I was thinking maybe just removing the databases folder and replacing it with a symbolic link to another place where it is actually stored. Not sure if OrientDB would complain about that or if there would be some unforeseen issue with performance or security.

From what I've seen so far, moving the data folder to another place is not the problem. There are references to the data folder in at least one file in the bin folder that has to be modified with each upgrade. Same goes for the config folder.

To see what I'm hinting at, grep for DB_PATH and CONFIG_FILE under the installation directory.

Hi @lethalspam

I answered you in private email, we are writing a comprehensive guide for this, it will be available in next few days

Acknowledged. Closing.

Thank you very much @lethalspam

I'm just reopening this to track that the doc page is correctly and promptly updated

Thanks

Luigi

Hi, is there an ETA when this may be completed?

I'm interested in this as well. Any update on whether the guide for upgrading the database has been written? Specifically, would like a method, if possible, that does not require me to export the old databases, and import it into the upgraded version.

Creating the symbolic links generated an authorization issue. The following steps were done:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  1. remove current databases folder in orientdb. ( sudo rm -rf databases)
  2. create symlink to another folder . (ln -s /to/new/database/databases databases)
  3. after creating the database I saw dir (name of create db) in /opt/orientdb/databases/
  4. I have replaced this dir to symlink folder (to /to/new/database/databases ).

All worked fine. But after restarting of orientdb I got an error where it is written that my login and password is not correct. The new dir for db is located in outside of "home" directory.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Each time we try to connect to the database via Studio, you get this 2nd challenge (see attachment) from the browser for some reason and the following is written in the log.

2016-01-20 16:19:59:202 SEVER Internal server error:
com.orientechnologies.orient.core.exception.OConfigurationException: Database 'testTemp' is not configured on server (home=/opt/orientdb/databases/) [ONetworkProtocolHttpDb]

Do you know how we can get around this issue? There is not one single password combination that we can try that works. Is there some additional permission setting that will clear this up?

Some info about installation permissions below.
darrell@stage-app01:/opt/orientdb/databases$ ls -al
total 16
drwxrwxr-x 4 apliasun apliasun 4096 Jan 20 14:33 .
drwxr-xr-x 10 apliasun orientdb 4096 Jan 20 12:02 ..
lrwxrwxrwx 1 apliasun apliasun 10 Jan 20 13:05 databases -> /databases
drwxrwxr-x 2 apliasun apliasun 4096 Jan 20 14:33 testTemps
drwxr-xr-x 3 apliasun apliasun 4096 Jan 20 13:53 VitaNavis

darrell@stage-app01:/databases$ ls -al
total 28
drwxrwxrwx 7 apliasun apliasun 4096 Jan 20 12:52 .
drwxr-xr-x 24 root root 4096 Jan 20 11:40 ..
drwxrwxrwx 2 apliasun apliasun 4096 Jan 20 11:50 GratefulDeadConcerts
drwxrwxrwx 2 root root 4096 Jan 20 12:52 test
drwxrwxrwx 3 apliasun apliasun 4096 Jan 20 13:19 testTemp
drwxrwxrwx 2 apliasun apliasun 4096 Jan 20 11:50 testTemps
drwxrwxrwx 3 apliasun apliasun 4096 Jan 20 11:51 VitaNavis

Hi @lethalspam,
we are trying to reproduce the issue,
what is your version of OrientDB ?

OrientDB Server v2.1.4 (build UNKNOWN@r; 2015-10-13 12:23:58+0000)

Hi @lethalspam,
if you create a new database, can you connect to it?

You can connect to it UNTIL you restart OrientDB. Then you get the error described above.

Hi @lethalspam ,
I have executed the following steps and it works

1) Remove the current "databases" folder in orientdb
2) Copy the folder "databases" in another location
3) Create a link in the folder orientdb named "databases" to the folder "databases"
4) Launch the server
5) Connect to the db from Studio
6) Turn off the server, re-start the server and connect to the db from Studio

Can you try with these steps ?

Hi, we can close this ticket. Thanks!

@SDIPro The client is waiting for documentation for the workaround. Would you be able to send those detailed instructions here?

Here's some current upgrade documentation:

Upgrading Databases

Before using the following instructions, be sure to check the latest version upgrading guide to see if your databases can be directly upgraded to a new release of OrientDB.

The easiest way to upgrade a database from one version of OrientDB to the next is to plan ahead for future upgrades from the beginning.

The recommended strategy is to store databases separately from the OrientDB installation, often on a separate data volume.

As an example, you might have a data volume, called /data, with a databases directory under that where all of your database directories will be stored.

/data/databases:
MyDB
WebAppDB

New Databases

If you're just starting with OrientDB or just creating new databases, from the OrientDB installation directory, you can remove the databases directory and then create a symbolic link to the /data/databases directory previously created.

Make sure OrientDB is not running.

On a Linux system, you could call rm -rf databases to remove the _databases_ directory and recursively remove all sub-directories.

DO NOT issue that command if you have any live databases that have not been moved!

Once the databases directory is removed, create a symbolic link to the /data/databases directory.

On a Linux system, you could call ln -s /data/databases ./databases.

On a Windows system, you can use mklink /d .\databases d:\data\databases, assuming your data volume resides as the d: drive in Windows. The /d switch creates a directory symbolic link. You can use /j instead to create a directory junction.

You should now be able to start OrientDB and create new databases that will reside under /data/databases.

Upgrading Symbolic-Linked Databases

If you used a similar symbolic link scheme as suggested in the prior section, upgrading OrientDB is very easy. Simply follow the same instructions to remove the databases directory from the NEW OrientDB installation directory and then create a symbolic link to /data/databases.

Upgrading Existing Databases

If you've been running OrientDB in the standard way, with the databases directory stored directly under the OrientDB installation directory, then you have two options when upgrading to a newer version of OrientDB.

  1. You can move your database directories to the databases directory under the new installation.
  2. You can move your database directories to an external location and then set-up a symbolic link from the new installation.

Moving Databases to a New Installation

Make sure OrientDB is not running. From the old OrientDB installation location, move each database directory under databases to the databases directory in the new OrientDB installation.

Moving Databases to an External Location

Make sure OrientDB is not running. Using the earlier example of /data/databases, from the old OrientDB installation location, move each database directory under databases to the /data/databases location.

Now, follow the instructions under New Databases to create a symbolic link from within the new OrientDB installation to the /data/databases directory.

External Storage Advantages

If you store your databases separately from the OrientDB installation, not only will you be able to upgrade more easily in the future, but you may even be able to improve performance by using a data volume that is mounted on a disk that's faster than the volume where the main installation resides.

Also, many cloud-based providers support creating snapshots of data volumes, which can be a useful way of backing up all of your databases.

Thanks @SDIPro and @lvca

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smolinari picture smolinari  路  29Comments

saeedtabrizi picture saeedtabrizi  路  24Comments

dmitrytokarev picture dmitrytokarev  路  25Comments

matthiasbe picture matthiasbe  路  30Comments

Bandes picture Bandes  路  34Comments