# Import

This guide helps you to import data from our legacy servers, which are using FeathersJS and MongoDB.

## Prerequisites

You need [docker](https://www.docker.com/) installed on your machine. Furthermore you need SSH access to the server and you need to know the following login credentials and server settings:

| Environment variable | Description                     |
| -------------------- | ------------------------------- |
| SSH\_USERNAME        | Your ssh username on the server |
| SSH\_HOST            | The IP address of the server    |
| MONGODB\_USERNAME    | Mongo username on the server    |
| MONGODB\_PASSWORD    | Mongo password on the server    |
| MONGODB\_AUTH\_DB    | Mongo authentication database   |
| MONGODB\_DATABASE    | The name of the mongo database  |
| UPLOADS\_DIRECTORY   | Path to remote uploads folder   |

## Run the database migration

Run `docker-compose` with all environment variables specified:

```bash
SSH_USERNAME=username SSH_HOST=some.server.com MONGODB_USERNAME='hc-api' MONGODB_PASSWORD='secret' MONGODB_DATABASE=hc_api MONGODB_AUTH_DB=hc_api UPLOADS_DIRECTORY=/var/www/api/uploads  docker-compose up
```

Download the remote mongo database:

```bash
docker-compose exec db-migration-worker ./import.sh
```

Import the local download into Neo4J:

```bash
docker-compose exec neo4j import/import.sh
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.human-connection.org/human-connection/docs_fix_link/backend/data-import.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
