Exporting Neo4j database for importing in another Neo4j-desktop application - database

I should say, that neo4j-admin tools didnt work for me.
neo4j-admin dump --database=<database-name> --to=<database-address>
and i get an error every time, that database doesnt exist.
so is there any other way to export my Neo4j database ??
C:\Users\Shafigh\.Neo4jDesktop\neo4jDatabases\database-2912eb35-11ba-4ae1-
b5b9-cb4b88a6f0a9\installation-3.4.7\bin> neo4j-admin dump --database=test_1
--to=C:/Users/Shafigh/Desktop/files
org.neo4j.commandline.admin.CommandFailed: database does not exist: test_1
at org.neo4j.commandline.dbms.DumpCommand.execute(DumpCommand.java:83)
at org.neo4j.commandline.admin.AdminTool.execute(AdminTool.java:127)
at org.neo4j.commandline.admin.AdminTool.main(AdminTool.java:51)
Caused by: java.lang.IllegalArgumentException: Directory
'C:\Users\Shafigh\.Neo4jDesktop\neo4jDatabases\database-2912eb35-11ba-4ae1-
b5b9-cb4b88a6f0a9\installation-3.4.7\data\databases\test_1' does not contain
a database
at
org.neo4j.kernel.impl.util.Validators.lambda$static$3(Validators.java:111)
at org.neo4j.commandline.dbms.DumpCommand.execute(DumpCommand.java:79)
... 2 more
command failed: database does not exist: test_1
snapshot of my Neo4j desktop
graph_db size

test_1 is just the name of your Neo4j Desktop "project". It is not the name of your "database".
Use this command line instead (which uses the default database name, which is what you are using):
neo4j-admin dump --database=graph.db --to=C:/Users/Shafigh/Desktop/files
[UPDATED with more details, from my comments]
Neo4j Desktop is an environment that allows you to have many projects, with each project having possibly multiple DBs and plugins with different versions. So, your "test_1" is just the name of your project. Within that project, each DB will have its own directory structure, and by default the directory in that structure that contains your DB is given the name "graph.db". You can change the name of that DB if you want by setting the dbms.active_database property in that DB's neo4j.conf file -- but that is rarely useful.

Related

MAMP Change Document Root Requires re-import of sql database

I develop on a Mac (High Sierra) with MAMP (basic, not Pro), and I have several different Drupal sites in ~/Sites/<sitename>.
Currently, if I change Document Root to work on a different site, I get errors on the new site until I delete the database .frm and .ibd files, as well as the log/data files, and re-import the database from a SQL dump.
Errors are:
2019-11-04T20:01:50.231324Z 2 [Warning] InnoDB: Cannot open table
/cache_bootstrap from the internal data dictionary of InnoDB
though the .frm file for the table exists. Please refer to
http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for
how to resolve the issue.
Files I have to delete:
/Applications/MAMP/db/mysql57/<sitename>/ (entire contents)
ibdata1
ib_logfile0
ib_logfile1
Re-importing the SQL database each time I want to work on a different site is getting really old. It is not a crisis, since this is just local development and it's not impacting the server, but it is seriously annoying. Has anyone else seen this?

Restore an Oracle database to another disk drive in Windows Server 2012

My question is about the following, it is required to pass a database of Oracle Database 10g Express Edition to 11g. I was given the backup on a pendrive, it is a file with extension .dmp (Dump file).
I installed the 11g Express Edition on a new server but also installed the database that comes with this (XE).
I want to restore the database from the 10g to another unit other than C, which is where the Oracle 11g database is installed. I also want this new database to "replace" the XE (I do not know if it is the correct way to say it).
I have only found adjustments and location changes but only within the same unit.
Any scope would be very useful.
Thank you.
Judging from the comments, it sounds like you have been given a Database Dump file (.dmp) from a database on a pendrive, and you need to figure out how to get that file into a database, correct?
First, let's go over some background. What is a dump file (.dmp)? From Oracle:
The dump file set is made up of one or more disk files that contain
table data, database object metadata, and control information. The
files are written in a proprietary, binary format. During an import
operation, the Data Pump Import utility uses these files to locate
each database object in the dump file set.
At a high level, that .dmp file is a collection of DDL and DML statements that will recreate whatever data and objects that were exported. .dmp files make it easier to transport and move large amounts of data between databases using Data Pump. But what is Data Pump? Again, from Oracle:
Oracle Data Pump technology enables very high-speed movement of data and metadata from one database to another.
Basically, Data Pump is a set of utilities (EXPDP & IMPDP) that are used to move data between databases. The .dmp file you have was likely created using EXPDP. You will need to use IMPDP to import that .dmp file into a database.
Here's were it gets interesting - you say that you already have an 11g database, correct? If you want to, you should be able to import the 10g dump file directly into your 11g database without any issues. The reason is that Oracle tends to be backwards compatible, and typically speaking, anything that you do with one version of Oracle will be compatible with the version that immediately succeeds it. Jumping from something like Oracle 8i to 11g won't work, but you can always go from 8i to 9i, from 9i to 10g, and so on.
If you want to import that dump file into your 11g database, here's what you'll need to do:
Create a DBA account, or have an account that has been granted Data Pump privileges explicitly.
Move the .dmp file to the server where your 11g database lives. If you want to make it even easier for yourself, you can move the .dmp file to your database's datapump directory. If you don't know where that is, execute the following query on your database: select * from all_directories where directory_name = 'DATA_PUMP_DIR'; This query will return a directory. You don't have to use this directory, it will just make it easier.
Once you have the dump file in place and you have all of the necessary database and operating system privileges, you are ready to import the dmp file. Open a new command line window, set your Oracle home if it is not already set, and then navigate to the directory where you placed the .dmp file. Your import command will look something like this:
impdp [USERNAME]/[PASSWORD]#[DATABASE] directory=[DIRECTORY] dumpfile=[FILENAME].dmp logfile=[LOGFILE].log
Where [USERNAME]/[PASSWORD] are your credentials, [DATABASE] is the name of the database you're importing the dump file into, [DIRECTORY] is whatever directory you placed the dump file in, [FILENAME] is the name of the .dmp file, and [LOGFILE] is whatever name you chose for your log file.
Assuming your database has everything necessary for the .dmp file, the import should begin and you will start seeing status updates that look similar to this:
Starting [USERNAME]."SYS_IMPORT_FULL_01": [USERNAME]/******** directory=DATA_PUMP_DIR dumpfile=[FILENAME].dmp logfile=[LOGFILE].log
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Note that this is just an example, your results may look different. Assuming all goes well, you will see a message like this at the end:
Job [USERNAME]."SYS_IMPORT_FULL_01" completed
If you don't want to import it into your existing 11g database, you could always spin up a new database and import the .dmp file to that one using these same guidelines.
That should be enough to get you started down the right path, hope this helps and good luck!
P.S. Here is a great FAQ on the Data Pump utilities as well: http://www.orafaq.com/wiki/Import_Export_FAQ

Troubling to specify parameter files with oracle database into c directory

Currently I just switched to Oracle database from Mysql now as i read freaky docs from here.
It says you must need to specify a parameter file but not being able to do that.
I mean i'm unable to find Oracle_home and i'm using windows 8 so it denies me to create any sort of files in C:\ directory .. Please guide me as well to do setup with Oracle database.
Help would be appreciated!
If you install an OFA-compliant database, using Oracle Universal Installer defaults, then Oracle home (known as ORACLE_HOME in this guide) is located beneath ORACLE_BASE. It contains subdirectories for Oracle Database software executables and network files.
ORACLE_BASE-/u01/app/oracle/product/11.2.0/dbhome_1
with subdirectories like:
bin,
rdbms,
sqlplus,
etc

What is the default location where mac stores sqlite3 databases

I want to pull data from a remote db into an sqlite database I just don't know where the path is to where mac stores sqlite3 files. It's just the default location.
This is the answer I came up with and will post it as an answer when SO lets me.
I don't know if this is the default but I never changed the sqlite3 settings on my macbook so I would assume that this is in fact the default location but like I said I don't know and it just worked for me.
The default location for me was
sqlite://my-apps-name.db
If you keep your sqlite db the same as your applications name all you need to do is give the application name which is also the db file's name after sqlite:// and that should do it.
SQLite3 is not a server-based DBMS like MySQL, which has a centralized location for all its served database files. It does not typically have a default (or even a central) location for databases. It relies on individual files for its databases, which could potentially be located anywhere within the file system.
If you want to create a database, it's up to you where to put it.
The default location for me was
sqlite://my-apps-name.db
If you keep your sqlite db the same as your applications name all you need to do is give the application name which is also the db file's name after sqlite:// and that should do it.

How do you export settings from the Database Publishing Wizard?

I'm using the Database Publishing Wizard in VS2008 to push changes to my hosting provider. It doesn't look like those settings go with the project (which seems a little silly to me), but rather they go with the machine.
On each new machine that I'd like to publish from I need to go through the process of digging up my database settings.
Is there a way to backup/export/save these settings to a file?
If so, what is it?
Hmmm ... it appears that the publishing wizard uses 2 config files for it's application configuration:
The Publish Database Wizard uses the
files user.config and hoster.config to
store configuration information. The
directory in which these files are
stored must have the appropriate NTFS
file system permissions set. These
files contain user names and encrypted
passwords. The passwords are encrypted
by using DPAPI.
user.config File
This file stores persisted host and
configuration settings for the Publish
Database Wizard. The user.config file
is located at %SystemDrive%\Documents
and Settings\%Username%\Application
Data\Microsoft\Microsoft SQL
Server\90\Tools\Publishing
Wizard\user.config.
hoster.config File
This file stores options about Web
service addresses, user names, and
databases for shared hosting
providers. The hoster.config file is
located at %SystemDrive%\Documents and
Settings\%Username%\Application
Data\Microsoft\Microsoft SQL
Server\90\Tools\Publishing
Wizard\hoster.config.
I'm trying to access these files in Vista (with VS2008 and SQL Express installed) and striking out. I'll keep you posted.
Update: Looks like I didn't have the Publishing Wizard installed after all. After grabbing the version for VS2008 here, and then installing (and don't worry -- you won't see any indication it's getting installed, but it does).... and THEN setting up my first database using the wizard, it looks like there are indeed some settings stored uder the 'Application Data' directory listed above. However, it looks like it's just a user.config, and then an XML file for each database configured. I believe you can backup each of these files for later use.

Resources