Moving neo4j database from Windows to Ubuntu - linux

I created neo4j database using cypher queries through browser and some python (py2neo) routines.
Now, I have to transfer this database to another neo4j instance on my Linux desktop.
What I did-
Zip the contents of folder default.graphdb.
Unzipped the contents of the zip file to data/graph.db in my linux installation.
Also the user:pass of the database are same.
But when I goto the browser, I can't find any of that data. The directory does point to the folder that I extracted to (/home/goelakash/neo4j-community-2.3.0/data/graph.db).
How do I get that database?
EDIT - messages.log
https://drive.google.com/file/d/0B3JPglmAz1b5ak1vRWR5Z0p5UVE/view?usp=sharing

The data files should be located directly in data/graph.db. So check e.g. if there is a file called neostore.nodestore.db. If so, check the permissions - the system user running Neo4j needs to have full recursive read/write permission on the graph.db folder.
Also make sure that you're using the same version of Neo4j on Windows and Linux (or upgrade the store following the reference manual).
For more insight attach the startup sequence form data/graph.db/messages.log.

Related

Writing a file to an Ubuntu 18.04 directory using postgres query tool

I have a Python program calling postgres queries then showing the results on the screen. So far Python and postgres both run on Windows. Now I want to move the database to Ubuntu.
I therefore want to write a file from postgres query tool to an Ubuntu 18.04 directory. Under Windows (old setting), writing the file from postgres query tool works without complications. Using the new postgres database on Ubuntu, I have added postgres to my personal (=mm) user group and changed the permissions of the corresponding folder (755). Even added a file temp.csv and changed the permissions of that file as well (755). Still, when trying...
create table temp (test text);
insert into temp(test) VALUES ('Sample text');
copy (select * from temp) to '/home/mm/temp.csv';
... I get ...
ERROR: could not open file "/home/mm/temp.csv" for writing: Keine Berechtigung [=No permission]
SQL Status:42501
Hinweis:COPY TO instructs the PostgreSQL server process to write a file. You may want a client-side facility such as psql's \copy.
I could write to a samba directory with "free for all" permissions, but I don't want to do that for data security reasons.
Does anyone have an idea?

How can I bundle my database file into my app, ready for a side load install?

I am creating a Windows 10 Universal App which uses a local SQLite Database.
In order for the app to use the database file It must be placed in:
C:\Users\<Username>\AppData\Local\Packages\<Name of Package>\Local State
Now I understand this is the 'local' file structure for the application. However I have a pre-made database that the app needs to interact with and therefore should be bundled as part of the app on install.
Is there a method of including my database in a usable fashion when distributing my application via a side-load install?
Furthermore, This problem is of paramount importance as This 'C:\' Directory will not exist when pushing my application to the mobile phone or other Windows 10 (not a desktop) device.
You cannot package the database directly as read-write data (local state). If you only ever need to read from the database, you can just include it in your project and read it from Package.Current.InstalledLocation.
If you need to write to the database, but it contains some initial values you want to ship with your app, then you still need to include the database in your project, but then copy it from the InstalledLocation to ApplicationData.Current.LocalFolder if it doesn't exist when your app starts up.
You can all ways export your existing data base as SQL script and save it in your project assets.
On the first run of your application you can create the Sqlite file in your LocalFolder, and run the script with CREATE and INSERT queries.

Restoring a MySQL database on a potentially different MySQL installation?

I have a broken installation of Ubuntu 14.04 - it won't boot, but I won't say anymore about that because that's not what I'm asking about really. I have a MySQL database (created using v5.5) on the broken Ubuntu installation and I need that data. I can get at the raw MySQL database files by mounting the broken installation onto another machine.
I actually need the database to be imported into a MySQL v5.1 installation. I tried copying the raw database files (e.g. the directory at /var/lib/mysql/dbname) into the same directory on the working OS installation. At first, it seemed like it worked, I can see the database, I can use it and I can list the tables. But it turns out that even though I can see the tables in the db, any attempts to describe or use them in any way give the 'table doesnt exist` error.
Ideally, I'd love to be able to use msqldump and then import the database the proper way, but how can I get a dump of the database if it's not part of the MySQL installation (remember, I can't boot into the installation, it's broken).
Of course, mysqldump is the most preferable solution, but if it's not possible to use that utility with the raw database files as input, then I'm willing to try anything that might work.
Of course the first thing you should do is to install the same version of MySQL as the original - if you're directly using the raw data files, keeping things as identical to the original as possible is a must! The same applies to paths, make sure the new installation and data files are placed in the same directory path that they were originally.
Once you have this, you can mysqldump the tables and use that to import into a clean, new installation.

Database folder on development mode

On arangodb's documentation it is suggested to use a different folder to databases during development phase (/tmp/fancy_db). I try to use this but I get errors saying that no database exists... How can I create databases on this temporary folder?
Thank you
arangod will not create any folder for you, you have to give it an existing folder on your system.
/tmp/fancy_db
is just a suggestion you can use any folder at any location on your machine.
However to create a folder in /tmp on a unix system open a terminal and enter:
bash> mkdir /tmp/fancy_db
On a windows system (as far as i know) \tmp is not available, you can use
C:\tmp\fancy_db
instead (create it with Explorer)

How do I get Sybase File Path, Transaction Log, & installation details?

I need to Retirve the following Details using Sybase SQL Query.
1) Database Data File Path
2) Database Transaction Log File Path
3) Path where SybaseSoftware Installed
4) Patch Installed on Sybase
Thanks.
That info is easy for a DBA to obtain in 30 seconds; with a GUI Admin tool in a few clicks.
Why do you want to obtain the details of the server installation VIA SQL ? If you are a coder you do not need that info to do your job; that info is the domain of the DBA, and changes as they administer the server. More important, the changes are transparent to the coder. Even if you did know it, it will not help or hinder you in your work.
Online Sybase Manuals
The "data and log file paths" in particular, are protected from direct access by developers (it is a secured ANSI SQL RDBMS).
Update
Evidently you did not bother to look up the manuals.
Open a session with the server, so that you can execute SQL commnands via "Sybase SQL Query". From your PC, Run either isql (character) or DBISQL (GUI); they are both on the Sybase PC Installation CD, you can also download them free.
Devices ("Data File Paths"):
sp_helpdevice
go
There are many Databases per server. There are many Devices per server. You will have to figure out (a) which Devices contain the Database you are interested in (b) Data Devices vs Log Devices.
sp_helpdb
go
Log Devices ("Database Transaction Log File Path")
(same as (1) )
"Sybase Installation" or $HOME directory (on the server). There are two methods, the first is much easier:
via host system
.
Log into the host system of the server, as the sybase user
You are already located in the sybase $HOME directory
It is the installation directory
(the original installer may have created directory trees for each version or EBF ("patch level"), but that is easy to figure out using Unix/DOS commands)
.
via islq/DBISQL
.
sp_configure "configuration file"
go
.
This will give you the path to the configuration file. It is almost always, the file path to the $SYBASE or sybase>$HOME directory. You can move up or sideways in the directory tree, using Unix/DOS commands, and figure it out from there.
.
The version of the Sybase ASE is the only item from your list that is relevant to coders. It (including current EBF ("patch level") is obtained via:
SELECT ##VERSION
go

Resources