Move LiveODM installation to new hardware

Hi,

I would like to move my configuration and processed data to new hardware.

I have a fresh install of LiveODM on the new hardware and I still have the old machine running so that I can export whatever data I need.

I thought it would be as simple as copying the /webodm/app directory to the new install, but that did not do anything.

Have anyone done something similar to what I am trying to archive and have any pointers?

Hey @hugo :hand: aside from the /webodm/app directory, you’ll want to make a backup/restore of the Postgres database.

Thank you for your reply!
How do I do the backup and restore of the postgres database?

I found this on google: https://www.postgresql.org/docs/9.1/backup-dump.html
Is this the right way to do a backup? If so, how do I find out what the database name is?

Since you are running the same version of Postgres (I think?) you could just move the entire db directory at /var/lib/postgresql/9.5/.

Yes, I should be using the same since both machines are installed from the LiveODM-iso.

I will try and report back. Thank you for the help!

I have now tried to move the folder /webodm/app and /var/lib/postgresql/9.6/ to the new install and restarted the machine but I get a error from the localhost webpage.

OperationalError at /
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Request Method:	GET
Request URL:	http://10.132.28.246/
Django Version:	2.1.11
Exception Type:	OperationalError
Exception Value:	
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Exception Location:	/webodm/python3-venv/lib/python3.5/site-packages/psycopg2/__init__.py in connect, line 130
Python Executable:	/webodm/python3-venv/bin/python3
Python Version:	3.5.2
Python Path:	
['/webodm',
 '/webodm/python3-venv/bin',
 '/webodm/python3-venv/lib/python35.zip',
 '/webodm/python3-venv/lib/python3.5',
 '/webodm/python3-venv/lib/python3.5/plat-x86_64-linux-gnu',
 '/webodm/python3-venv/lib/python3.5/lib-dynload',
 '/usr/lib/python3.5',
 '/usr/lib/python3.5/plat-x86_64-linux-gnu',
 '/webodm/python3-venv/lib/python3.5/site-packages',
 '/webodm/python3-venv/src/rio-tiler',
 '/webodm']
Server time:	Thu, 30 Jan 2020 14:36:56 +0100s

Well, something didn’t work (the postgres service is probably not starting). Check the status via sudo systemctl status postgresql or sudo service status postgresql.

Perhaps the permissions are wrong?

Seems that way… I actually just copied the folder from one machine to the other, without stopping the postgresql. To do that I had to use chown odm /var/lib/postgresql -R so that I was able to copy it, then I changed the owner back to posgres as before.

A little update:

I did a full reinstall of LiveODM and followed the guide from DigitalOcean but I still get the exact same output of sudo systemctl status postgresql or sudo service status postgresql

Mm, another approach could be to use the pg_dump | psql command pairs as indicated in https://stackoverflow.com/a/1237806