Export/import database

Hi,
I have installed baserow in my pre-production cluster and create some tables in a database.
I’m using docker images baserow:1.10

I now install basrow in my production environment and want to migrate database from preproduction to production

I tried to export each tables and import them in the production baserow but table field are lost (type , fk …)

I tried to copy data from /baserow/date but the container failed to start

How to migrate database from one cluster to another ?

Hi @come, since you are self-hosting, you can leverage internal Baserow commands to import & export applications (databases) of a group.

So let’s say that your original group has id=60, then you could export as:

django-admin export_group_applications 60

And import on the new instance as:

django-admin import_group_applications 70 group_60

The group_60 is the name of the export, this would be the default name. 70 would be a group id of the new group on the new instance. You would need to transfer this file from the old to the new Baserow instance.

These commands are DJango commands, hence why they are called through django-admin (or manage.py file).

These commands can be run from backend containers in the docker-compose setup, not sure from top of my head if this will work out of the box in the single Docker image.

See Install with Docker // Baserow for a guide on how to do this with the baserow/baserow:XYZ docker image (the single one Petrs refers to above in his solution).

Thanks for your reponses

How can I find the id of my group ?

I tried to run the command but I have this exception with root:

Traceback (most recent call last):
File “/baserow/backend/src/baserow/manage.py”, line 40, in
main()
File “/baserow/backend/src/baserow/manage.py”, line 36, in main
execute_from_command_line(sys.argv)
File “/baserow/venv/lib/python3.7/site-packages/django/core/management/init.py”, line 419, in execute_from_command_line
utility.execute()
File “/baserow/venv/lib/python3.7/site-packages/django/core/management/init.py”, line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/baserow/venv/lib/python3.7/site-packages/django/core/management/base.py”, line 354, in run_from_argv
self.execute(*args, **cmd_options)
File “/baserow/venv/lib/python3.7/site-packages/django/core/management/base.py”, line 398, in execute
output = self.handle(*args, **options)
File “/baserow/backend/src/baserow/core/management/commands/export_group_applications.py”, line 55, in handle
with open(files_path, “wb”) as files_buffer:
PermissionError: [Errno 13] Permission denied: ‘/group_11.zip’

May I have a response ?

Can you provide the exact details of the exact command you ran and how you ran it? From the looks of your error whatever command you are running cannot write out to that location. Even if running as root on your host OS, file permissions and users are different inside docker containers: docker file permissions - Google Zoeken .

Here is my command in the baserow container root user, folder /

./baserow.sh backend-cmd manage export_group_applications 1

I don’t know how to get my group id ?

It’s weird I can create a file by touching in this folder with root user, why baserow.sh can’t ?