Restore Neo4j DB from Backup with Neo4J Desktop - neo4j

I have a db backup folder that I'm trying to load into a new db in Neo4J Desktop.

You'll need to use the neo4j-admin tool
From Neo4j desktop, go to your database/create a new one, then open the Terminal for that database (in older versions, it was in the Manage menu, in newer versions, you'll find it in the 3 ... menu)
Once you have the terminal open, cd bin and follow the manual to restore

Related

Neo4j Dump and Restore

Ubuntu 20.04 running multiple databases running with different version numbers in a project in Neo4j Desktop 1.2.7 and need to move them over to a newly installed machine with the latest version of Neo4j Desktop (not sure which version that is because on the SSD that's unplugged right now!).
Tried:
bin/neo4j-admin dump --database="MYDATABASENAME" --to=/dumps/MYDATABASENAME-.dump"
Which gives error "Database does not exist" error as I understand the default database is "neo4j" and that this somehow contains the other databases? Makes no sense to me.
Tried:
bin/neo4j-admin dump --database=neo4j --to=/dumps/DougiDatabases.dump"
...Thinking that the neo4j database may contain all the other databases and that did dump. but the file was only 5Mb or so, where my databases are a number of Gb, so clearly not correct.
In system database I do SHOW DATABASES and it shows me the neo4j and system databases, but nothing else.
I've seen some mention of a dump button in the three dots by a database in Neo4j Desktop, but I don't have that (regardless of DB running or not). I only have a clone option.
Previously I have copied the database files from the /home/MYNAME/.config/Neo4j Desktop/Application/neo4jDatabases folder and then updated the databases listed in the /home/MYNAME/.config/Neo4j Desktop/Application/persist/databases.json, but it seems that the folder structure in the latest version of Neo4j Desktop has a different structure, so I wasn't sure if I could still do this. Not tried.
Driving me mad. This should be so easy.
What do I do please?
I worked it out. For databases 3.x you need to use "graph.db" as the database name. For databases 4.x you always use "neo4j" as the database name.
e.g.
bin/neo4j-admin dump --database="graph.db" --to="/dumpsFolder/myDatabase.dump"
bin/neo4j-admin dump --database="neo4j" --to="/dumpsFolder/myDatabase.dump"
You need to to into the admin area for each database, launch the terminal and execute these commands. In the latest version of Neo4j Desktop you can then copy the dump files into the root of the project. e.g.
/home/USERNAME/.config/Neo4j Desktop/Application/projects/project-XXX
Then click the ... next to the dump name in Neo4j Desktop and "create from dump file" or similar. You select the database version, name it, set a password and continue. The database will restore.

Move Neo4j databases in Neo4j Desktop from one computer to another

I am upgrading my local machine from Ubuntu 16.04 to 20.04. I run Neo4j Desktop (version 1.2.7) on my 16.04 and have installed it on the 20.04 machine and want to move the databases over.
I'm sure that in the past I just copied and pasted the database folders in /home/dougi/.config/Neo4j Desktop/Application/neo4jDatabases from one computer to the other and started Neo4j Desktop. However, when I do that no database show in the project.
I tried doing a dump and load, but couldn't see how I would load the database into Neo4j Desktop on the 20.04 machine as you have to "create" a database for it to show in the project and the database version when creating is limited to 4.0.3 and all of my databases are earlier versions than that (I don't want upgrade them right now).
I tried creating a database, deleting the files in the folder created in /home/dougi/.config/Neo4j Desktop/Application/neo4jDatabases and pasting the database folder from the 16.04 machine into it (i.e. replacing the files it created). I just get a message saying that the database files have been moved or corrupted when I load Neo4j Desktop.
I tried running a load from a dump I had made and had an error saying WARNING: Max 1024 open files allowed, minimum of 40 000 recommended.. I did find some google articles on that, but this felt like a really messy way of doing the restore so I didn't go any further with that.
What is the easiest way to move Neo4j Desktop databases from one computer to another please?
Thank you!
OK, so the answer to this is that there is a file /home/dougi/.config/Neo4j Desktop/Application/persist/databases.json which contains the list of databases that display in Neo4j Desktop.
Create a new database to add an entry to the file and then copy and paste that entry, replacing the database ID and version with those of the new databases you are adding files for to create an entry for each of the databases.
Restart your computer and delete the temporary database you created.
Or you could just copy the file from your previous version of Neo4j Desktop, assuming there are no formatting changes between versions of Neo4j Desktop.

How to start the Community Edition in Neo4j Desktop?

I would like to use Neo4j to learn how graph databases work and make some experiences with my own datasets. According to that and since Neo4j claims to be open source I've downloaded the Windows Neo4j Desktop version, but every project and database initialized shows the "Enterprise" attribute which means that I just initialized the Enterprise edition.
Any idea how to setup a project and a database based on the community edition?
Solved it. If you dont setup path variables you have enter the bin directory via cmd and type "neo4j.bat install-service" and then neo4j.bat to start the database-server. The officiall installation instructions should have those details.
just open a commandline in the bin folder. There you execute the command "neo4j.bat console" which creates a local server, that you then reach via localhost:7474.
The neo4j Download Center allows you to choose between downloading the Enterprise Edition, the Community Edition, and the Desktop.

How to perform a Neo4j database backup in Windows 10?

The neo4j documentation says that I gotta run some commands from the neo4j-admin tool, which is a terminal supposedly located in the bin folder, but I can't find that tool. there's also a cypher shell but when I open it as an administrator it shuts down immediately. Is there any other way of performing the backup? The neo4j version is 3.2.3.
I think that the simplest way to do a full database backup is coping the content of the data folder.
According the docs (file locations):
For /Windows zip installation the folder is <neo4j-home>\data
Using desktop installer the folder is %APPDATA%\Neo4j Community Edition

Get old wamp installation data to work on new computer

I'm having a big problem with my wamp server for some months now.
I've developed 6 sites locally using wamp server. I had a problem with my computer and copied all my site directories to a hard Disk.
I got a new computer with W8.1 on it and copied back the wamp-folder. I tried to lunch it, but its not working. So i've installed a new wamp server. But i've no idea how to import my site from the old server to the new.
My first problem is that I can't get my old site running on the new wamp installation. I did not save my databases before my computer went down.
But I thing I can find it on the mysql folder from the old system backup. Where and how, I've no idea. So I would like to take my sites from the old wamp and installed it on the new one or get it to work on the new wamp. I've already googled for one month now but I could not find any solution!
Option 1. ReCreate the old WAMPServer on the new PC
If you have the complete directory structure backed up from your old PC then you can just copy the complete folder structure from your backup to the new PC.
Make sure you put it on the same disk and folder that it was originally installed on, so if it was originally installed in C:\wamp make sure you copy it back to that folder.
Launch the wampmanage.exe from that folder ( C:\wamp\wampmanager.exe )
Using the wampmanager menus do
left click wampmanager -> Apache -> Install Service
left click wampmanager -> MYSQL -> Install Service
WAMPServer should now be as it was before your problem
Windows 8.1 has a blank C:\windows\system32\drivers\etc\hosts file, so you will also need to add all the domains for any Virtual Hosts you had created, but at a minimum it should have these entries.
127.0.0.1 localhost
::1 localhost
Option 2. Add your old Apache/PHP/MYSQL to the new installation of WAMPServer
Remember, one of the big advantages of WAMPServer over other Windows AMP stacks is its ability to have more than one version of each of Apache/PHP/MYSQL in the same WAMPServer instance ready for easy switching between verions of all of these.
So you could keep the new installation and selectively copy over the Apache/PHP/MYSQL versions and then copy over your 6 sites.
So STOP WAMPServer
copy the OLD \wamp\bin\apache\{apacheversion} folder to NEW `\wamp\bin\apache\
copy the OLD \wamp\bin\php\{phpversion} folder to NEW `\wamp\bin\php\
copy the OLD \wamp\bin\mysql\{mysqversion} folder to NEW `\wamp\bin\mysql\
Restart WAMPServer
You should now see that the old and new version of Apache/MYSQL/PHP are available.
Now copy your OLD \wamp\www\??? site folders into NEW \wamp\www\??? and your 6 sites should also be available.
Now you can switch back to the old versions of Apache/PHP/MYSQL and run your sites like that, or backup you databases properly using the old MYSQL version and then restore them to your new MYSQL version
You switch versions using the wampmanager menus like so:-
wampmanager -> Apache -> Version -> (click the required version number )
wampmanager -> MYSQL -> Version -> (click the required version number )
wampmanager -> PHP -> Version -> (click the required version number )
Six years later, I just resolved this exact same problem. I tried #RiggsFolly's solutions to no avail. Reading logs to try debugging this whole mess became tedious real fast, especially if the paths between the old and the new installations don't match anymore.
Considering a new clean wampserver installation and an old wamp(64) directory from somewhere else:
First, export your mysql's databases.
To do that, use the command line to reach C:\path\to\old\wamp\bin\mysql\mysql{version_number}\bin and start the mysql server with the mysqld command (when you are done exporting, use mysqladmin -u {user name} shutdown). Now, export your databases with mysqldump or any other method you will find around and re-import them inside your new installation.
Transfer the folders of your projects inside www from the old to the new installation.
Recreate your virtual hosts by pointing the paths out to the related pasted folders inside www.
There you go. This way, everything was cleanly imported and you don't have to worry about a dirty setup which will bug at some point.
I hope it helps someone else.

Resources