{"__v":1,"_id":"57163fe15d90dc170060ee9d","category":{"project":"566c97797831040d003eb3bc","version":"566c97797831040d003eb3bf","_id":"57163f41b5af590e00a0ff35","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-04-19T14:22:57.969Z","from_sync":false,"order":4,"slug":"data-migration-bulk-data-loading","title":"Data migration, bulk data loading"},"parentDoc":null,"project":"566c97797831040d003eb3bc","user":"5716283e40ef9c2000cac92a","version":{"__v":10,"_id":"566c97797831040d003eb3bf","project":"566c97797831040d003eb3bc","createdAt":"2015-12-12T21:54:01.970Z","releaseDate":"2015-12-12T21:54:01.970Z","categories":["566c977a7831040d003eb3c0","5716338cb5af590e00a0ff1d","57163947893cbe0e002d75fc","57163f41b5af590e00a0ff35","57cd74d2873de50e00724a2f","57cd7de8baaee30e0093ecc3","57d6ada046dcc30e007dd15e","57fdc2b31646dc0e0010480a","57fdd8b86c9d141900d87bf1","58767da4d89ef20f003b6f1e"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-19T14:25:37.555Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"To import, export, or restore entire Neo4j databases from a backup, you must copy and replace the full Neo4j datastore — which is the graph.db directory containing the store files.\nImport and export can be managed from the Admin tab in the GrapheneDB UI.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Supported Import formats\"\n}\n[/block]\nGrapheneDB expects a single compressed file containing the *graph.db* directory and the store files located inside. Supported formats are: **zip, tar, cpio, gz, bz2 and xz**.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Importing from your local Neo4j database into GrapheneDB\"\n}\n[/block]\nGrapheneDB supports uploading Neo4j store files to replace the store files in your GrapheneDB database. In order to import your local database into GrapheneDB, follow the steps below:\n\nStep 1: **Important!** Make sure your local Neo4j instance is stopped.\nStep 2: Put the entire contents of graph.db in a compressed file.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \" $ tar -cjf graph.tar.bz2 neo4j/data/graph.db\",\n      \"language\": \"shell\",\n      \"name\": \"Example (UNIX)\"\n    }\n  ]\n}\n[/block]\nStep 3: From the Admin tab, use the Restore button to initiate the import process.\nStep 4: Upload the compressed file from your local machine or provide a URL to a publicly accessible URL (i.e. a public link to a file hosted in an AWS S3 bucket).\n\n## GrapheneDB export\n\nThere is a manual export feature that enables you to download a zipped file with your database. This feature is available across all plans, including Sandbox. This can be used together with the restore feature to clone your databases within GrapheneDB or to take your data elsewhere (i.e. your development machine).\n\nYou will this feature inside the *Admin* tab of your database management area:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/bbIePPJTkSZ6St5e0WTQ_image01_2.png\",\n        \"image01_2.png\",\n        \"1000\",\n        \"195\",\n        \"#5c9ab3\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"It is important to know that the database export process requires to stop the database meanwhile your data are copied. The incoming requests will be queued up during the process and served after the instance is up and running again.\\n\\nYou will be responsible of the exported data storage (we will not keep it!).\"\n}\n[/block]\n## GrapheneDB restore\n\nYou will find our restore database feature inside the *Admin* tab of your database management area:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/jPOUf8xBQpSDcTBQtdrk_image01.png\",\n        \"image01.png\",\n        \"1000\",\n        \"233\",\n        \"#fa7575\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nOn *Restore database* button click, a dialog will be displayed and you will be able to upload a file from your computer or provide a URL to a publicly accessible file on the internet.\n\nIf you want to upload a local database you must put the contents of the graph.db folder in a compressed file.  For example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ tar -cjf graph.tar.bz2 neo4j/data/graph.db\",\n      \"language\": \"shell\",\n      \"name\": \"Example (UNIX)\"\n    }\n  ]\n}\n[/block]\nSupported formats: zip, tar, cpio, gz, bz2 and xz\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"If you want to try out Neo4j and you are looking for example data there are some datasets on the [neo4j.org website](http://www.neo4j.org/develop/example_data). You don't need to download the files, you can copy the download link URL and paste it in the restore dialog.\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/F9kxrR6QRauOAKyYj9M0_image02.png\",\n        \"image02.png\",\n        \"528\",\n        \"660\",\n        \"#7cacbc\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nThe Neo4j instance will be stopped, the store files replaced, and then Neo4j will be started up again. If Neo4j fails to start properly, the database will be rolled back to its previous state before the restore attempt.\n\n## Troubleshooting\n\nWhen a restore process fails, it’s usually due to one of the following reasons:\n\n* The store files were copied while Neo4j is still running: Make sure Neo4j is stopped.\n* The store files correspond to a newer version of Neo4j than the one on GrapheneDB: Make sure you restore to the same version or higher.\n* The compressed file is not a supported format: Make sure you use one of our supported formats, which include zip, tar, cpio, gz, bz2 and xz.\n* There are store files missing within the compressed file: Make sure the archive contains the full *graph.db* directory and all files inside (use the recursive option when creating the archive).\n\n## Supported Archive Formats\n\nThe following archive formats are supported for archiving: zip, tar, cpio, gz, bz2 and xz.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Loading an exported datastore into a local Neo4j instance\"\n}\n[/block]\nThe exported GrapheneDB database can be loaded into a local Neo4j instance as follows: \n\nStep 1. Export your GrapheneDB Neo4j instance from the *Admin* tab, by using the Export button.\nStep 2. Copy the contents of the compressed zip file into *path/to/neo4j/data/graph.db* in a local instance of Neo4j.\nStep 3. Restart the Neo4j server.\n\nIf you are using the desktop Neo4j application, the steps will vary as follows:\n\nStep 1. Export your GrapheneDB Neo4j instance from the *Admin* tab, by using the *Export* button\nStep 2. Select the location of the compressed zip file by clicking on the *Choose* button.\nStep 3. Click on *Start* to start up your server again.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/bbFMy9HITIyzMy5VMoMV_image00.png\",\n        \"image00.png\",\n        \"563\",\n        \"286\",\n        \"#e38785\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"importing-and-exporting-databases","type":"basic","title":"Importing and exporting databases"}

Importing and exporting databases


To import, export, or restore entire Neo4j databases from a backup, you must copy and replace the full Neo4j datastore — which is the graph.db directory containing the store files. Import and export can be managed from the Admin tab in the GrapheneDB UI. [block:api-header] { "type": "basic", "title": "Supported Import formats" } [/block] GrapheneDB expects a single compressed file containing the *graph.db* directory and the store files located inside. Supported formats are: **zip, tar, cpio, gz, bz2 and xz**. [block:api-header] { "type": "basic", "title": "Importing from your local Neo4j database into GrapheneDB" } [/block] GrapheneDB supports uploading Neo4j store files to replace the store files in your GrapheneDB database. In order to import your local database into GrapheneDB, follow the steps below: Step 1: **Important!** Make sure your local Neo4j instance is stopped. Step 2: Put the entire contents of graph.db in a compressed file. [block:code] { "codes": [ { "code": " $ tar -cjf graph.tar.bz2 neo4j/data/graph.db", "language": "shell", "name": "Example (UNIX)" } ] } [/block] Step 3: From the Admin tab, use the Restore button to initiate the import process. Step 4: Upload the compressed file from your local machine or provide a URL to a publicly accessible URL (i.e. a public link to a file hosted in an AWS S3 bucket). ## GrapheneDB export There is a manual export feature that enables you to download a zipped file with your database. This feature is available across all plans, including Sandbox. This can be used together with the restore feature to clone your databases within GrapheneDB or to take your data elsewhere (i.e. your development machine). You will this feature inside the *Admin* tab of your database management area: [block:image] { "images": [ { "image": [ "https://files.readme.io/bbIePPJTkSZ6St5e0WTQ_image01_2.png", "image01_2.png", "1000", "195", "#5c9ab3", "" ] } ] } [/block] [block:callout] { "type": "warning", "body": "It is important to know that the database export process requires to stop the database meanwhile your data are copied. The incoming requests will be queued up during the process and served after the instance is up and running again.\n\nYou will be responsible of the exported data storage (we will not keep it!)." } [/block] ## GrapheneDB restore You will find our restore database feature inside the *Admin* tab of your database management area: [block:image] { "images": [ { "image": [ "https://files.readme.io/jPOUf8xBQpSDcTBQtdrk_image01.png", "image01.png", "1000", "233", "#fa7575", "" ] } ] } [/block] On *Restore database* button click, a dialog will be displayed and you will be able to upload a file from your computer or provide a URL to a publicly accessible file on the internet. If you want to upload a local database you must put the contents of the graph.db folder in a compressed file. For example: [block:code] { "codes": [ { "code": "$ tar -cjf graph.tar.bz2 neo4j/data/graph.db", "language": "shell", "name": "Example (UNIX)" } ] } [/block] Supported formats: zip, tar, cpio, gz, bz2 and xz [block:callout] { "type": "info", "body": "If you want to try out Neo4j and you are looking for example data there are some datasets on the [neo4j.org website](http://www.neo4j.org/develop/example_data). You don't need to download the files, you can copy the download link URL and paste it in the restore dialog." } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/F9kxrR6QRauOAKyYj9M0_image02.png", "image02.png", "528", "660", "#7cacbc", "" ] } ] } [/block] The Neo4j instance will be stopped, the store files replaced, and then Neo4j will be started up again. If Neo4j fails to start properly, the database will be rolled back to its previous state before the restore attempt. ## Troubleshooting When a restore process fails, it’s usually due to one of the following reasons: * The store files were copied while Neo4j is still running: Make sure Neo4j is stopped. * The store files correspond to a newer version of Neo4j than the one on GrapheneDB: Make sure you restore to the same version or higher. * The compressed file is not a supported format: Make sure you use one of our supported formats, which include zip, tar, cpio, gz, bz2 and xz. * There are store files missing within the compressed file: Make sure the archive contains the full *graph.db* directory and all files inside (use the recursive option when creating the archive). ## Supported Archive Formats The following archive formats are supported for archiving: zip, tar, cpio, gz, bz2 and xz. [block:api-header] { "type": "basic", "title": "Loading an exported datastore into a local Neo4j instance" } [/block] The exported GrapheneDB database can be loaded into a local Neo4j instance as follows: Step 1. Export your GrapheneDB Neo4j instance from the *Admin* tab, by using the Export button. Step 2. Copy the contents of the compressed zip file into *path/to/neo4j/data/graph.db* in a local instance of Neo4j. Step 3. Restart the Neo4j server. If you are using the desktop Neo4j application, the steps will vary as follows: Step 1. Export your GrapheneDB Neo4j instance from the *Admin* tab, by using the *Export* button Step 2. Select the location of the compressed zip file by clicking on the *Choose* button. Step 3. Click on *Start* to start up your server again. [block:image] { "images": [ { "image": [ "https://files.readme.io/bbFMy9HITIyzMy5VMoMV_image00.png", "image00.png", "563", "286", "#e38785", "" ] } ] } [/block]