{"id":13530132,"url":"https://github.com/jexp/store-utils","last_synced_at":"2025-08-09T06:26:26.527Z","repository":{"id":13447420,"uuid":"16136810","full_name":"jexp/store-utils","owner":"jexp","description":"Utilities to compact, copy, fix, analyse Neo4j stores","archived":false,"fork":false,"pushed_at":"2022-10-14T13:18:09.000Z","size":158,"stargazers_count":93,"open_issues_count":33,"forks_count":35,"subscribers_count":14,"default_branch":"3.5","last_synced_at":"2025-04-14T19:08:46.411Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jexp.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-22T10:59:18.000Z","updated_at":"2025-01-20T17:52:23.000Z","dependencies_parsed_at":"2023-01-11T18:35:31.124Z","dependency_job_id":null,"html_url":"https://github.com/jexp/store-utils","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jexp%2Fstore-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jexp%2Fstore-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jexp%2Fstore-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jexp%2Fstore-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jexp","download_url":"https://codeload.github.com/jexp/store-utils/tar.gz/refs/heads/3.5","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248943456,"owners_count":21186958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T07:00:44.286Z","updated_at":"2025-04-14T19:08:52.296Z","avatar_url":"https://github.com/jexp.png","language":"Java","funding_links":[],"categories":["Tools","REST API"],"sub_categories":["REST API","Other"],"readme":"## Notice\n\nPlease download a released version, else you must have Apache Maven. (Apache Maven not installed)\n\n## Tool to copy Neo4j Stores\n\nFrom Neo4j 4.0 please use the [official tool](https://neo4j.com/docs/operations-manual/current/backup-restore/copy-database/) that has the same capabilities.\n\nUses the BatchInserterImpl to read a store and write the target store keeping the node-ids.\nCopies the manual (legacy) index-files as is, please note it performs no index upgrade!\n\nYou will have to recreate any schema indexes too.\n\nIgnores broken nodes and relationships and records them in `target/store-copy.log`\n\nAlso useful to skip no longer wanted properties, relationships with a certain type.\nOr of certain labels and even nodes with certain labels.\n\nGood for store compaction and reorganization of relationships and properties as\nit rewrites the store file reclaiming space that is sitting empty.\n\nNOTE: With Neo4j 3.x there are two different store formats, so you have to provide \"enterprise\" or \"community\" as first argument of the call!\n\nYou can now also decide if you want to compact the node-store, then you have to pass \"false\" as the parameter for keep-node-ids.\n\n### Usage\n\nGrab the release for your Neo4j version from: https://github.com/jexp/store-utils/releases\n\nDefine the $NEO4J_HOME, the $NEO4J_HOME/lib should contain all the jars\n\n```\nunzip store-util-*-release.zip \ncd store-util-*/\n\n#feel free to change this\nexport NEO4J_HOME=/usr/share/neo4j\n\n#IMPORTANT: maven and internet access will be required if NEO4J_HOME is not set properly\n[ ! $(ls $NEO4J_HOME/lib/*) ] \u0026\u0026 echo \"NEO4J_HOME does not contain the libraries, will fall back to maven\"\n\n\n# remove target db\nrm -rf /path/to/fixed.db\n\n./copy-store.sh community /path/to/source.db /path/to/fixed.db\n```\n\n#### NOTICE\n\n**With Neo4j 3.5.x the location of the `store_lock` file changed to one level above the database directory, so please make sure that your source and target db don't share the same parent directory**\n\nThen you would see an error like this:\n\n```\nException in thread \"main\" org.neo4j.kernel.StoreLockException: Unable to obtain lock on store lock file: \n/path/to/parent-folder/store_lock. \nPlease ensure no other process is using this database, and that the directory is writable (required even for read-only access)\n```\n\n### Config \n\nConfig will read from `neo4j.properties` file in current directory if it exists, but command line options override.\n\nneo4j.properties\n\n```\nsource_db_dir=\ntarget_db_dir=\n\nkeep_node_ids=true\n\nproperties_to_ignore=\nlabels_to_ignore=\nlabels_to_delete=\nrel_types_to_ignore=\n\nstore_copy_log_dir=\nbad_entries_log_dir=\n```\n\n### General Usage\n\n    copy-store.sh [enterprise|community] source.db target.db [RELS,TO,SKIP] [props,to,skip] [Labels,To,Skip] [Labels,To,Delete,Nodes] [keep-node-ids:true/false]\n\n\nThe provided script contains these settings for page-cache (note you can configure a different, smaller setting for the source store than the target store).\n\n    dbms.pagecache.memory.source=2G\n    dbms.pagecache.memory=2G\n\nHeap config is in the shell-script, default is: 4 GB Heap\n\n    export MAVEN_OPTS=\"-Xmx4G -Xms4G -Xmn1G -XX:+UseG1GC\"\n\n**Please adapt the settings as needed for your store.**\n\n**Please note that you will need the memory for (source-page-cache + target-page-cache + 1x heap) as it opens 2 databases one for reading and one for writing.**\n\nChange the Neo4j version in pom.xml before running as needed. (Currently 3.4.5)\n\nOptionally changeable from the outside with `-Dneo4j.version=3.4.5` on the `mvn` invocation.\n\n### Internally\n\n\n\nNote: maven is called under the hood :\n\n    mvn compile exec:java -Dexec.mainClass=\"org.neo4j.tool.StoreCopy\" -Penterprise \\\n      -Dexec.args=\"source-dir target-dir [REL,TYPES,TO,IGNORE] [properties,to,ignore] [Labels,To,Ignore] [Labels,To,Delete,Nodes] [keep-node-ids:true/false]\"\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjexp%2Fstore-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjexp%2Fstore-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjexp%2Fstore-utils/lists"}