Showing results for 
Search instead for 
Did you mean: 

Creating a database and then renaming it or copying it to another within the same instance

Node Link

Neo4j 4.3
Desktop 1.2.7

I want to be able to create a database, and then either drop an already existing database and rename the new database that of the recently dropped database, or create a duplicate of the newly created database and give it the name of the recently dropped database.
Ideally I would like to, in some form, save an instance or the database that is to be dropped/replaced, in case of any issues during the process, the procedure can then revert back to the original database.


Graph Maven
Backup the existing database into data/dumps folder by running this command in the terminal window:

bin/neo4j-admin backup --backup-dir=data/dumps --database=xyz

Restore this backup as a different database:

bin/neo4j-admin restore --from=data/dumps/xyz --database=xyzz --force

or if this is a single instance you might want to consider using

Node Link

i have tried using these listed above but when creating the database i get an error:

I tried to do a copy, create a back up and force restore from it to a newly named DB, and nothing seems to work. I noticed when I created the backup or copy that the directory would be owened by root. so I ran chown -R neo4j:neo4j against the directory to make sure it that was not the issue before i created the database in the browser, but still get the same error.
What version of Neo4j?

Does the logs/debug.log provide any detail as to why it doesnt come up?

This is what I am seeing in the logs:

> 2021-04-19 16:57:30.996+0000 INFO [c.n.d.DbmsReconciler] Database allnew is requested to transition from EnterpriseDatabaseState{databaseId=DatabaseId{2cedd4d8[allnew] }, operatorState=STOPPED, failed=true} to EnterpriseDatabaseState{databaseId=DatabaseId{2cedd4d8[allnew] }, operatorState=STARTED, failed=false}
> 2021-04-19 16:57:30.996+0000 WARN [c.n.d.DbmsReconciler] Attempting to reconcile database allnew to state 'online' but has previously failed. Manual force is required to retry.
> 2021-04-19 16:57:30.996+0000 ERROR [c.n.d.DbmsReconciler] Encountered error when attempting to reconcile database allnew from state 'EnterpriseDatabaseState{databaseId=DatabaseId{2cedd4d8[allnew] }, operatorState=STOPPED, failed=true}' to state 'online' An error occurred! Unable to start database with name `allnew`.
> org.neo4j.dbms.api.DatabaseManagementException: An error occurred! Unable to start database with name `allnew`.
> Caused by: java.lang.RuntimeException: java.nio.file.AccessDeniedException: /data/databases/allnew/neostore
> Caused by: java.nio.file.AccessDeniedException: /data/databases/allnew/neostore