# Loading data into a Neo4j instance on AWS EC2

**URL:** <https://community.neo4j.com/t/loading-data-into-a-neo4j-instance-on-aws-ec2/15072>\
**Category:** Aura & Cloud\
**Tags:** aws, ec2, linux, cloud\
**Created:** [February 25, 2020, 8:17pm UTC](https://community.neo4j.com/t/loading-data-into-a-neo4j-instance-on-aws-ec2/15072 "2020-02-25T20:17:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gclindsey](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/gclindsey/32/27725_2.png) [@gclindsey](https://community.neo4j.com/u/gclindsey)\
**Post date:** [February 25, 2020, 8:17pm UTC](https://community.neo4j.com/t/loading-data-into-a-neo4j-instance-on-aws-ec2/15072/1 "2020-02-25T20:17:03Z")

</div>

I'm trying to set up an EC2 server with Neo4j and a GraphQL API that our development team can access. I could hack together a solution but I was curious to know what others recommend, in case I'm missing anything.

We have data stored in Google Sheets which I import directly by running a Cypher query on my local machine. However, I need to automate the initial loading, or seeding, of the database. How is this usually done?

The two options I see are 1) run the loading script through cypher-shell once the EC2 instance and Neo4j are running or 2) download the graph.db file into the data/databases through the User Data. I'm using a public AMI running Neo4j. Just wondering if I am going about this correctly.

---

<div class="post-metadata">

**Author:** ![stefan.armbruster](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/stefan.armbruster/32/74_2.png) [@stefan.armbruster](https://community.neo4j.com/u/stefan.armbruster)\
**Post date:** [February 25, 2020, 9:12pm UTC](https://community.neo4j.com/t/loading-data-into-a-neo4j-instance-on-aws-ec2/15072/2 "2020-02-25T21:12:38Z")

</div>

You could also use the "export to csv" link of your google sheet and use that URL with `LOAD CSV WITH HEADERS FROM <google-csv-url>`.

---

<div class="post-metadata">

**Author:** ![gclindsey](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/gclindsey/32/27725_2.png) [@gclindsey](https://community.neo4j.com/u/gclindsey)\
**Post date:** [February 27, 2020, 1:31am UTC](https://community.neo4j.com/t/loading-data-into-a-neo4j-instance-on-aws-ec2/15072/3 "2020-02-27T01:31:29Z")

</div>

Yes, that is how it's loaded using the Cypher query and the url link. But I might not have been clear, how can I automate this when starting an EC2 instance with Neo4j?

---

<div class="post-metadata">

**Author:** ![stefan.armbruster](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/stefan.armbruster/32/74_2.png) [@stefan.armbruster](https://community.neo4j.com/u/stefan.armbruster)\
**Post date:** [February 27, 2020, 9:21am UTC](https://community.neo4j.com/t/loading-data-into-a-neo4j-instance-on-aws-ec2/15072/4 "2020-02-27T09:21:52Z")

</div>

You could use APOC cypher initialzers, see [https://neo4j.com/docs/labs/apoc/current/operational/init-script/](https://neo4j.com/docs/labs/apoc/current/operational/init-script/)

---

<div class="post-metadata">

**Author:** ![roberto1](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/roberto1/32/9505_2.png) [@roberto1](https://community.neo4j.com/u/roberto1)\
**Post date:** [February 27, 2020, 4:19pm UTC](https://community.neo4j.com/t/loading-data-into-a-neo4j-instance-on-aws-ec2/15072/5 "2020-02-27T16:19:53Z")

</div>

Hi, you could use several things like some shells, but I think ansible could be your best fit. Here is a reference that you could use to deploy Neo4j

> **[Backup and restore Neo4j Graph Database using Ansible](https://www.opcito.com/blogs/backup-and-restore-neo4j-graph-database-using-ansible)**
>
> Use this easy and detailed step-by-step guide to learn how to backup and restore neo4j graph database using ansible.
