# Set the folder for the server database - Docker installation

**URL:** <https://discourse.joplinapp.org/t/set-the-folder-for-the-server-database-docker-installation/42418>\
**Category:** Support\
**Created:** [10 December 2024 17:36 UTC](https://discourse.joplinapp.org/t/set-the-folder-for-the-server-database-docker-installation/42418 "2024-12-10T17:36:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![guyan](https://avatars.discourse-cdn.com/v4/letter/g/5fc32e/32.png) [@guyan](https://discourse.joplinapp.org/u/guyan)\
**Post date:** [10 December 2024 17:36 UTC](https://discourse.joplinapp.org/t/set-the-folder-for-the-server-database-docker-installation/42418/1 "2024-12-10T17:36:44Z")

</div>

### Operating system

Linux

### Joplin version

3.0.1

### Desktop version info

Joplin Server v3.0.1 installed on a Docker Container

### Sync target

Joplin Server

### What issue do you have?

I run a Joplin server on a Raspberry following this guide: [Joplin Server Documentation - #13 by joplin\_user](https://discourse.joplinapp.org/t/joplin-server-documentation/24026/13)  
It seems working very well and I connected many devices all syncronized.

My point is: how to dowload/export the full database for a backup? I need a clear procedure to be prepared in case of failures of something.  
I read about setting a specific folder setting about store all the data but I got this:

```auto
$ sudo docker exec -it be7b5614eab5 node packages/server/dist/app.js storage import --connection 'Type=Filesystem; Path=/mnt/ssd1/Joplin-DB'
node:internal/modules/cjs/loader:1143
  throw err;
  ^

Error: Cannot find module '/home/joplin/packages/server/packages/server/dist/app.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
    at Module._load (node:internal/modules/cjs/loader:981:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.20.4

```

What is the specific issue about? How to solve?  
What do you suggest about?

I think it is good also to have only a periodic backup of the full database (including all the data) somewhere. To do that I thought to use the following commands:

```auto
pg_dump -U <joplin.db_user> --clean --no-owner --no-privileges -d <joplin.db_name> > db-dump.sql

```

and then to restore:

```auto
psql -U <joplin.new_db_user> -d template1 -c "DROP DATABASE <joplin.db_name>"
psql -U <joplin.new_db_user> -d template1 -c "CREATE DATABASE <joplin.db_name>"
psql -U <joplin.new_db_user> <joplin.db_name> < /tmp/db-dump.sql

```

The point is that I don't know how to find the db name and db user, and if the procedure effectively works, it is good or you suggest something better.  
Anyway if you give a clear list of commands it will be very helpful.

I tried this command:

```auto
$ sudo docker exec -e PGPASSWORD=<password> <ID_container> pg_dump -U <id_user> <db_name> | gzip > /mnt/ssd1/Joplin-DB/backup_$(date +%Y%m%d_%H%M%S).sql.gz

```

and it downloaded a big gz file. Is it only a DB without data, or it contains all the data? If I upload this on a new server, is it like having already all the data inside? How to upload this on an existing Joplin server database? How to extract from it only the data?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/1/c/1c948e33314e232a0927789508474d8624f4270b.png) [@system](https://discourse.joplinapp.org/u/system)\
**Post date:** [9 January 2025 17:37 UTC](https://discourse.joplinapp.org/t/set-the-folder-for-the-server-database-docker-installation/42418/2 "2025-01-09T17:37:32Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
