Importing Neo4J Database from GrapheneDB to Local - neo4j

I have created an app that uses a Neo4J database. I developed a local instance in Windows, purchased some space on a development GrapheneDB server, migrated my database, and had a few users test out my app. There are a few issues in my application that I wish to debug. I want to do development on a copy of their data only on my local instance of Neo4j. GrapheneDB offers the ability to download a graph.db.zip file that contains the contents of the database. How do I import this file using Neo4j desktop? It appears Neo4J desktop only imports csv files. I tried overwriting the graph.db folder with the contents of the zip file and my database doesn't appear in my Neo4J desktop. How do I import my GrapheneDB to my local?

Two approaches that are probably fairly similar under the hood:
Use neo4j-admin
Create a local graph in Neo4j Desktop
I used the same graph name as I'd used in Graphene
Make sure the database version is the same as is in Graphene
Do not start the database yet but instead click Manage, then the Terminal tab
Unzip the contents of the graphdb.zip file somewhere local - say, C:\Temp\graphdb for this example
Run neo4j-admin restore --from="C:\temp\graphdb"
Start the database using Neo4j Desktop
You should have a working database
File copying by hand
Create a local graph in Neo4j Desktop
I used the same graph name as I'd used in Graphene
Make sure the database version is the same as is in Graphene
Do not start the database yet but instead click Manage, then Open Folder
Enter the databases folder - it should be empty
Create a new folder called graph.db (the name needs to be exact)
Copy the contents of the graphdb.zip file into the new graph.db folder
Start the database using Neo4j Desktop
You should have a working database
I tested this on a graph with only one node, but it did work - I suspect the database version matching is pretty vital.

Related

Neo4j Desktop - Difference between Database and File?

I'm new to Neo4j. I've just opened the Desktop application. Starting a Project, the dashboard lists "Add Database" and "Add File". If data is stored in a database then what's a file? I don't get what a file does. Off hand, when I click on each (either the sample database or the sample file) they open the database browser thing so this doesn't help to understand the difference either..
You would use Add File to reference a file with a Cypher query (or series of Cypher queries).
When you open a file that you've saved here, it will open the browser window (associated with the currently running Database) and paste the file contents into the query box.
So this is a more portable way to save important queries saved in files (such as already established scripts in Cypher) that you expect to run often or reuse/test across databases.
Add Database is used to create a new database instance (technically "dbms" would be the better term, since this doesn't have to do with multi-database features in Neo4j). You can select the version of Neo4j to use for the database, and configure and manage it as needed.

How to find Couchbase Mobile DB file in iOS?

I want to find Couchbase Mobile DB file location in iOS and please also describe how to open db file?
Thanks
If you are using CBM 1.4 or earlier, you can locate the location of the cblite2 db file as discussed here
https://developer.couchbase.com/documentation/mobile/1.4/guides/couchbase-lite/native-api/manager/index.html#dude-wheres-my-database-file
To view the database , you can use CouchbaseLiteViewer which is (not officially supported ) Mac application
https://github.com/couchbaselabs/CouchbaseLiteViewer.
You could also use any sqlite browser such as http://sqlitebrowser.org to browse the sqlite content
CouchbaseLiteViewer is not updated for checking data in Cblite 2.0 , i
waiting for it so as of now following way check Cblite db data and it
will work.
Latest solution Couchbase 2.0 db check:
There is a command line tool which I believe is inside the zip file that you download to get Couchbase Lite (look in tools) called "cblite" which is similar to the sqlite command line tool. It can perform operations on a database such as listing documents, querying, etc.
Download Couchbase sdk from the website
It comes with the folder inside this, there is a folder called Tools .
Screenshots for reference :
3.Inside tools cblite is there , just launch it . now suppose i have cblite db .
Use following way to query and this tools provide you comannd terminal way to search data/document :
I tried this and it works 👍
shobhakar$ ./cblite /Downloads/mobile-travel-sample-master/ios/TravelSample/TravelSample/prebuilt/travel-sample.cblite2
Opened database /Downloads/mobile-travel-sample-master/ios/TravelSample/TravelSample/prebuilt/travel-sample.cblite2/
This is the current solution and this is awesome.
Reference link : https://github.com/couchbase/couchbase-lite-ios/issues/2176#issuecomment-423921463

pgadmin 4: Exporting .tar file

I am trying to use pgAdmin 4 on my personal laptop (Windows operating system with PostgreSQL 9.6) to export a database as a .tar file. I had issues importing csv through the Import/Export tool as well, and could only import successfully when doing the following:
COPY public.build_info FROM 'C:\time_table.csv' CSV HEADER;
I have read a few questions that resort to backing up a database through the command line, but I am hoping to complete this within pgAdmin4.
My current steps are:
right click my database (in this case Housing_DB)
Choose my directory to save (same place the csv files were imported from)
Add additional information (encoding, file type, name, etc.)
I get an error immediately connected to Permissions, but have struggled to determine how to fix this issue:
Does anybody know how I could go through and provide permissions to be able to back up this database? I have looked at the documentation pertaining to backup/restore but did not see anything covering permissions (https://www.pgadmin.org/docs4/1.x/backup_dialog.html).
It looks like your C:\ is protected by administrator account which can't be written by user postgres. Can you try again with locations like your 'Desktop' or 'Temp' folder.

How can I view the Tables structure in sqlite Manager add-on on Firefox?

I am creating a Database called Reminder.sqlite via Sqlite Manager add-on in firefox, after creating I am importing it to my iOS Application, the problem is that records are saved in database table but when I run a Select query in Sqlite manager no records are displayed any suggestions why this is happening?
make sure you have add database file into project and remove database file from document directory.
because old file is exist in document director, your new file with same name cannot be overwrite old one.(according to approach, if we use in code)
It may help you.

Firefox addon: Connecting to SQLite database located in the addon's "data" folder

I am writing my first firefox add-ons using the addon-sdk.
The purpose of this add-on is to
get data from a specific page,
use this data to query the SQLite database built in the add-on,
append the results of the queries in the specific page.
I have created my SQLite database with sqlite3 and stored it as myDB.db in the "data" folder or the add-on.
But when I try to open my database it does not work.
I tried like this without any success:
// Import the needed modules
var {Cu} = require("chrome");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/FileUtils.jsm");
// Open SQLite database
let file = FileUtils.getFile(self.data, ['myDB.db']);
let mDBConn = Services.storage.openDatabase(file); // Will also create the file if it does not exist
I changed the location previously set to "ProfD" in the Mozilla storage documentation because the database is not there (or should I copy it there?).
Please tell me if I should proceed differently. I thought about SQLite because there are going to be a few queries.
From Wladimir Palant's accepted answer of "How to initialize SQLite file for Firefox add-on?"
As of Add-on SDK 1.5, extensions are no longer uncompressed upon
installation - they stay as packed XPI files on disk (which is good
for performance). SQLite needs a physical file however, not something
inside an archive.
You should use the ProfD folder to store your file. This also means that whatever data is stored in your db, remains there during upgrade or retro installation

Resources