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.
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.
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.
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.