Senaite on docker: How to backup and migrate data?

Hi,
I am new to senaite LIMS. I am currently running it in docker on Ubuntu laptop. It works fine.

However, I would like to know how to backup the data and import the data later. Just in case that I need to migrate to a new PC in the future. I find that installing a newer version in docker will be a fresh system and it cannot read the existing database.

I think this is important for me to understand before using it to store all the future data.

Thank you

1 Like

Hi sweizhong, welcome to the community!

First, I highly recommend searching this site for previous queries regarding this and other questions you might have. It’s quite likely been answered before.

Docker is awesome, however, it’s not recommend to run docker containers for a production instance in this use case for a number of reasons: When you kill the container, you will lose all data. Read the documentation, here. I believe support for Docker is beyond the scope of this forum, however, given it’s popularity, I’m sure you’ll find tons of resources out there if you want to persist with this route.

What data are you trying to migrate? The config or the database? The ZODB blob cannot be readily migrated as you’re suggesting - someone else here might be able to explain the process of migrating as I haven’t approached this yet.

Installing on a Laptop probably isn’t a great idea, beyond an initial test and poke around, or offline development. Try using a cloud instance of ubuntu if you don’t have access to a dedicated server.

If this is your first exposure to Plone, which I think it is, it can be a bit different to the typical databases / data structures we come across. It can definitely be intimidating at first but persist and you’ll see the benefits. The Plone documentation is really useful too. I hope this helps.

Cheers,
Dan

1 Like

Thank you. Now I learnt something and found the way to create backup of the database and restore it on a new installation. :grinning:

Now I am trying to understand how custom template for analysis report can be create and added into my senaite lims installation.
I am now reading on GitHub - senaite/senaite.impress: HTML to PDF Rendering Engine for SENAITE but with my very basic knowledge, I have difficulty in understanding how it works.

1 Like

Posting my thought process as I know of others who also weren’t aware how to do it. The way I suspect to do it (or at least have done a backup yet, but not tested the restore function yet) for test server from remote cloud server:
I’m using my own version of the docker-compose.yml file v 3.9. I first stop the server with command:
$ docker compose stop

I then backed up my /senaite-docker (project folder in Linux server which contains the “data” folder - which is the docker’s storage mount) to Windows with the pscp command (need to have Putty installed I think - else if backing up to another Linux system the SCP command can likely be used). So for me it was in CMD:

C:\>pscp -r root@139.177.179.4:senaite-docker linode_backup_senaite

The syntax for the pscp command is is:

pscp [optional_switches] source destination

…so the opposite order (and obviously switching source and destination) can likely be done again to restore the “backup”, obviously first stopping the docker container again before the copy and restarting afterwards (not sure if this is necessary, but done it anyway - not in production for me so I could stop the containers)

I’m not a Linux administrator, so comments are welcome as I haven’t yet tested the restore function yet to prove that this will work.