Export DB into another baserow account!

Dear Baserow users and fans,

I’m migrating from Baserow installed manually on a Debian to a Baserow installed using Docker compose. Both run on different machines.

How do I safely get one of my databases with all the PDF files from the manual version of the Baserow to a Docker-based version of Baserow on the other machine?

There is no “Export DB” feature in the UI. And those table exports don’t really export the whole setup.

1 Like

Hello, @taubers, have you seen this thread: Export/import database - #2 by petrs?

Probably good to add that the files themselves are not stored in the database. So if you are going to use the same storage, the db migration is enough (for the file names etc.). Otherwise you will need to copy the files between the storage buckets.

2 Likes

Hi, Olga!

Thank you very much for your message!

Yes, I’ve seen it, but it also isn’t that helpful due to the lack of the Workspace ID and other open questions.

And also it does not say, where the export is saved. It also seems that there is no “export_workspace_applications” function in my baserow:

Sure, I just wanted to make sure. :slightly_smiling_face:

@petrs, maybe you could help out @taubers here please?

1 Like

The image is cut off, why do you think the command is not there? It will save the file in the working directory from the perspective of the admin command. You can find the source for the command here: backend/src/baserow/core/management/commands/export_workspace_applications.py · develop · Baserow / baserow · GitLab

I still don’t see it:

But do you mean I should drag the source .py file into this directory and run it?

And - how to do I find the right Workspace ID?

And - “Otherwise you will need to copy the files between the storage buckets” - do you mean media folder files should be moved from one instance to another?

It seems that you are on some old version where the command is called export_group_applications. It is exactly the same command, only we were renaming groups to workspaces. Sorry for the confusion!

You can also forget about this serialized JSON representation and just transfer the Postgres database instead if the commands here give you trouble.

1 Like

Ok, so, what do you suggest to do with the files, since as you say “files themselves are not stored in the database”. I want to transfer both the workspaces with it’s entries and the files that were attached to the individual rows.

The files are in the storage that you configured for your instance. So if for example you used S3 before and plan to keep it, you wouldn’t need to do anything.

If your storage location changes, you will need to move them manually. From the docs:

By default, Baserow will store these files on the file system at the location set by
the MEDIA_ROOT environment variable, which is /baserow/media in our baserow/backend
image or $DATA_DIR/media for the baserow/baserow all-in-one image.

The command ./baserow.sh backend-cmd manage export_group_applications 35 really seems to do something:



root@556184fde463:/# ./baserow.sh backend-cmd manage export_group_applications 35
 [STARTUP][2023-10-23 14:08:40] Using provided external postgres at host.docker.internal or the  DATABASE_URL  
 [STARTUP][2023-10-23 14:08:40] Using embedded baserow redis as no REDIS_HOST or REDIS_URL provided.   
 [STARTUP][2023-10-23 14:08:40] Importing REDIS_PASSWORD secret from /baserow/data/.redispass  
root@556184fde463:/#

No output, and no errors.

But where and in what form do I access the data and how do I import into the new docker instance?

I see 2 directories in the baserow/media folder.

root@556184fde463:/# ls -la baserow/media            
total 96
drwxr-xr-x 4 root                root                  4096 Jan 25  2022 .
drwxr-xr-x 1 baserow_docker_user baserow_docker_group  4096 Oct 16 13:00 ..
drwxr-xr-x 5 root                root                  4096 Jan 25  2022 thumbnails
drwxr-xr-x 2 root                root                 77824 Jun  7  2022 user_files

Thumbnails contains just few directories:

root@556184fde463:/# ls -la baserow/media/thumbnails/
total 212
drwxr-xr-x 5 root root  4096 Jan 25  2022 .
drwxr-xr-x 4 root root  4096 Jan 25  2022 ..
drwxr-xr-x 2 root root 65536 Jun  7  2022 card_cover
drwxr-xr-x 2 root root 65536 Jun  7  2022 small
drwxr-xr-x 2 root root 65536 Jun  7  2022 tiny

while “user_files” folder contains lots of documents like .png, .jpg images, .pdf, .docx files. One larger file does not contain extension though and ends with a .

$DATA_DIR/media contains slighlty different folder structure:

root@556184fde463:/# ls -la $DATA_DIR/media
total 104
drwxr-xr-x 6 baserow_docker_user baserow_docker_group  4096 Sep 20  2022 .
drwxr-xr-x 8 root                root                  4096 Aug 22  2022 ..
drwxr-xr-x 2 baserow_docker_user baserow_docker_group  4096 Oct 13 16:06 export_files
drwxr-xr-x 5 baserow_docker_user baserow_docker_group  4096 Aug 22  2022 thumbnails
drwxr-xr-x 3 baserow_docker_user baserow_docker_group  4096 Sep  7  2022 user_1
drwxr-xr-x 2 baserow_docker_user baserow_docker_group 81920 Aug 22  2022 user_files

So, I still confused as of where to look to see the exported directory and how to import it in order to have my workspace with all the columns, rows and files inside the new docker image.

You said you are using docker compose? Can you give me the exact command? Perhaps I can try locally and give you precise instructions.

If you are doing the export I think no need to move the files themselves, that would be in case you were moving the database (because the files are not stored in the db).

Unfortunately I couldn’t wait any longer for a solution and ended up manually creating a workspace in the new instance, adding manually everything. Hope there will be something like “export Workspace”/“import Workspace” feature available in the future through the Dashboard.

Sorry for the inconvenience, @taubers! I’ve added the idea of having a feature for ‘export/import of a workspace’ to the list of discussions. :raised_hands:

1 Like

Hello @taubers, after discussing it with the team, I can confirm that we plan to make it possible to import/export a workspace through a dashboard: Export/import workspace (#2076) · Issues · Baserow / baserow · GitLab.

1 Like

Thank you! That’s great news!