In actual-time applications, we ought to take backup of our utility database frequently, in order that we can restore to a few working situation at any failure point.
This rule is applicable for each RDBMS and NoSQL databases.
In this section, we're going to talk about approximately two essential DBA responsibilities.
- How to again up a Neo4j Database.
- How to repair Neo4j Database to a selected backup.
Note − These steps are applicable to Windows Operating System most effective. We must use similar type of commands to do the same steps in other running structures.
Neo4j Database Backup
Step 1 − Click "Neo4j Community" the use of the following path −
Windows "Start" button → "All Programs" → "Neo4j Community" → "Neo4j Community"
By default, it selects c:Users[username]DocumentsNeo4jdefault.Graphdb. However if we want to, we will trade the route to a extraordinary directory.
Step 2 − Here we've got changed to our Neo4j Database folder.
C:Ne04j2.0db
Step 3 − Click the "Start" button.
Once the server begins, we are able to take a look at our Neo4j Database files are generated at a specified directory.
Before taking a database backup, the first and essential factor we have to do is shutdown the Neo4j Database server.
Step 4 − Click the "Stop" button to shut down the server.
Neo4j Database documents are to be had at C:Ne04j2.0db
Step 5 − Open the command activate.
Step 6 − Create a folder "Neo4jDbBackup-01" at C:Neo4j (This can be any location to your document machine).
Mkdir C:Neo4jNeo4jDbBackup-01
It creates a brand new folder "Neo4jDbBackup-01" at the desired document device location "C:Neo4j"
Step 7 − Type the subsequent command and press Enter key.
copy C:\Ne04j2.0db C:\Neo4j\Neo4jDbBackup-01
This means our files are copied to the desired vacation spot folder. Access that folder and observe that the folder has our database documents.
Step 8 − Use any Windows compression/decompression tool like WinZip, 7 Zip, or WinRAR to zip our Database folder.
Step 9 − Now our Neo4jDbBackup-01.Zip file is created. If you've got any memory constraints on your record device, then put off "Neo4jDbBackup-01" folder at "C:Neo4j"
Neo4j Database Restore
Step 1 − Shutdown the database server. Please check with the previous steps to close down the server.
Step 2 − Empty the modern database folder.
Step 3− Use any Windows compression/decompression device like WinZip, 7 Zip, or WinRar to unzip our backup folder.
Step 4 − Open the command activate and execute the following command.
Copy C:\Neo4j\Neo4jDbBackup-01 C:\Ne04j2.0db
Now we can observe that our database folder contains working backup documents
Step 5 − Start the server with the aid of clicking the "Start" button.
Step 6 − Execute a few MATCH + RETURN commands to verify whether we've got restored our database properly.