I'm working with someone who is using OrientDB v2.0.2 and I absolutely 
cannot get any of the backups or exports that he is sending me to 
completely import or restore.

I'm working on a clean VPS with a fresh installation of OrientDB from the 
githubs v2.1-rc4 (I was on v2.0.x the last time we tried this process).

I have 3 different files from him that he has exported using the web 
interface, the commandline, and the automated backup system.

The one from the web interface is called `prod-20140502150511.json`, but it 
isn't json at all, it's actually a 270kb .zip file full of pcl files and 
whatnot
The one from the commandline is called `prod.gz` and it is a gzipped json 
file, 3.3mb.
The one from the automated backups is called `prod-backup-20140522.zip`, 
but it's only 87 bytes so that can't be right.

Two came from his local server, the automated one came from the formerly 
live server.

When I fire up the database ./bin/server.sh it asks me to create a "root" 
password. I chose "mysecret".

In another screen session I run ./bin/console.sh to connect.

That goes fine.

Now on to the terriblenesses.

First off I haven't found any rhyme or reason as to when it wants me to run 
something as root vs as admin, but as I've tried to mix and match I've 
discovered that it sometimes want me to run things as admin but using the 
root password, which was very confusing. But whatever, I try it as root and 
if it fails I try it as admin and one way or the other it eventually allows 
me to run the desired command.

SERVER SETUP

    # clear out all the garbage I may have created
    rm -rf databases
    
    # run the server
    ./bin/server.sh


DATABASE SETUP

It seems like a RESTORE procedure should work on an empty database, but 
whenever I try it complains that the database doesn't exist, so I create it

    disconnect
    DROP DATABASE plocal:./databases/prod admin admin
    CREATE DATABASE plocal:./databases/prod admin admin plocal graph
    # when I create it, it connects automatically, but if it didn't I would 
run this as well
   # CONNECT plocal:./databases/prod/ admin admin

I run these steps every time I'm about to try something new - just in case


ACTUAL RESTORE

I try the 87 byte file without much in the way of hope, but surprisingly it 
says it was successful...

    RESTORE DATABASE /tmp/prod-backup-20140522.zip
    Database restored in 0.11 seconds

    classes
    Error: com.orientechnologies.orient.core.exception.ODatabaseException: 
Database 'plocal:./databases/prod/' is closed

    CONNECT plocal:./databases/prod/ admin admin
   classes
    ...
    TOTAL = 10

Not surprisingly, it's just the default database. Nothing happened.


I drop and recreate and try with the so called "json" file that is actually 
a 270kb zip file.

    RESTORE DATABASE /tmp/prod-20140502150511.json
    Restoring database DATABASE /tmp/prod-20140502150511.json...
    - Uncompressing file googletaxonomy.pcl...
    - Uncompressing file name_id_map.cm...
    - Uncompressing file e.cpm...
    ...
    Database restored in 0.16 seconds

    classes
    Error: com.orientechnologies.orient.core.exception.ODatabaseException: 
Database 'plocal:./databases/prod' is closed

    CONNECT plocal:./databases/prod/ admin admin
    2015-06-26 00:12:01:128 WARNI {db=prod} Error deserializing record with 
id #0:1 send this data for debugging: 
 <https://gist.github.com/coolaj86/20eb38f5b3fc8f28dae0> 
 [ORecordSerializerBinary]
    Error: com.orientechnologies.common.exception.OException: Error on 
creation of shared resource
    
    Error: java.lang.ArrayIndexOutOfBoundsException: 115

I take the hint, ctrl+c, and restart ./console.sh

    CONNECT plocal:./databases/prod/ admin admin
    Error: 
com.orientechnologies.orient.core.exception.OSecurityAccessException: User 
or password not valid for database: 'prod'

My best guess is that the restore also restored the admin password. 
Thankfully I happen to know it.

    CONNECT plocal:./databases/prod/ admin secret
    classes
    ...
    TOTAL = 13

Hmm... now I have a few more classes and a few record and, but it's fewer 
than what I was expecting. The app using the database still complains about 
missing classes.

So what the heck, I'll try importing the .gz file that's actually a 'json' 
file, gzipped.

    IMPORT DATABASE /tmp/prod.gz -preserveClusterIDs=true 
-rebuildIndexes=true -merge=true -migrateLinks=true
  # see output at <https://gist.github.com/coolaj86/7c1373afff96f9bc0485>

That was a fail, so I drop the database and try again from ground 0

    IMPORT DATABASE /tmp/prod.gz -preserveClusterIDs=true 
-rebuildIndexes=true -merge=true -migrateLinks=true
  # see output at <https://gist.github.com/coolaj86/3bff13167cc6af4d3cdb>

Well, that bombed too.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to