How to backup/export/import data between servers when using docker

Hello everyone.

Almost 2 years that i’m running emoncms in docker using a linux VM inside esxi 6.5 but is time to move on.
Now i will run proxmox and i don’t want use the same VM, but instead use proxmox container, i try install the backup app inside docker on current installation but i’m not succeed as the app is for run in emonpi.

So if anyone can help how i can migrate the data to the new containet i would love that.

The Mysql database is external so no problem with that data, but the redis things is docker and i already try put a new emoncms instance and setting the old database but the feeds and apps settings appear to don’t be in the mysql or for some reason don’t work… so if anyone can point me the way…

EMONCMS, Version 10.2.3

Thanks

If you look at the backup module, there is a file emoncms-export.sh. You will need to modify the config file to suit, but this should run from the command line.

I have an emoncms container running on Proxmox installed using the emonscripts and an Ubuntu Container (rather than a full VM). This then adds all the additional modules like backup as well. Note, the best way to do it is create a Pi user on Ubuntu.

Works great, Much better that ESXi.

@borpin thank you or your time.

I will try and create a new container in proxmox follow your steps.

@borpin do you follow any guide to install in the proxmox container?

Nothing special, just pulled in the Ubuntu LXC template, updated it and then used the emonScrips Guide for Ubuntu.

@borpin thanks for you help for some reason that i don’t know i’m not able to install it … or at least i think not, the sudo keeps always report an error
sudo: setrlimit(RLIMIT_CORE): Operation not permitted
So i don’t know if is ok or not.

About how todo the backup in the current VM i don’t know what to set in the database_path if anything… is mysql database is indepedent from emoncms…

Thanks

You need to install sudo probably.

I got those but ignored them and it seemed to be fine.

Did you create a pi user and add them to sudoers, then log in as pi?

Just wondering, how you’re supposed to backup emoncms when you’re running in Docker? I can exec into the web Docker container but that’s not where the databases are?

Use the builtin backup facility to backup Emoncms?

This does not ‘backup’ the container, but that is a different issue.

Yeah, don’t want to back up the Docker image, just want to backup emoncms and redploy, outside of Docker. I don’t seem to have any Backup menu options like the docs suggest I should have:

image

Components has it listed, but not sure how to access it:

I noticed that I could edit Inputs, /device/list.json fails with:

**Fatal error** : Uncaught Error: Call to a member function fetch_object() on bool in /var/www/emoncms/Modules/device/device_model.php:274 Stack trace: #0 /var/www/emoncms/Modules/device/device_model.php(235): Device->load_list_to_redis(1) #1 /var/www/emoncms/Modules/device/device_model.php(225): Device->get_list_redis(1) #2 /var/www/emoncms/Modules/device/device_controller.php(65): Device->get_list('1') #3 /var/www/emoncms/core.php(75): device_controller() #4 /var/www/emoncms/index.php(240): controller('device') #5 {main} thrown in **/var/www/emoncms/Modules/device/device_model.php** on line **274**

After looking around, it turns out the Docker image is a bit out of date and there’s a new preferred method, which I’m trying to migrate to.

Ok, suggest you start a new thread if still a problem.

1 Like