Migration to a new server with different file path

I’m about to migrate my owncloud server to a new, more powerful server.
It seems like there is no migration wizard so I’m looking for a little help.

Old / running server :

  • Classic Mysql + Apache2 owncloud server
  • Files : /raid10/owncloud/data
  • MySQL : localhost:

New server:

  • Dockerized owncloud with external Mysql db
  • Files : default owncloud volume /mnt/data
  • Mysql : in another docker container

Mysql backup/restore and rsync will move files to the new server.
But since the old and new server aren’t having the same file location, how can I convert or tell owncloud that the files location has changed?

I think this applies here as well.

How To Manually Move a Data Directory

1 Like

But this is to move data in the same physical server isn’t it?
I cannot do a symlink between 2 different servers and since it’s dockerized I didn’t have access to the old location either.

Regards,
xk3tchuPx

This document says not to migrate servers and change the data directory at the same time: https://doc.owncloud.org/server/10.0/admin_manual/maintenance/migrating.html

You can change the path before or after the migration is completed (just not during).

1 Like

Before you migrate to the new server on the old one, create a symlink from /mnt/data to your current data directory and follow all the steps in the article @alfredb linked.
Once finished you can migrate your installation to the new server.

If it’s already too late you could also try to adjust your docker container. There are a lot of environment variables available: https://github.com/owncloud-docker/base#available-environment-variables

I would try the following steps

  1. set OWNCLOUD_VOLUME_ROOT to /raid10/owncloud/data in your .env file.
  2. mount your docker volume in the correct spot via the docker-compose.yml.

But that would require some docker debugging skills, as can’t give you an exact explanation. You would just have to try.

1 Like

@eneubauer in the article of @alfredb that says to rsync before creating the symlink.
I do not have enough space on my old server to rsync everything to /mnt/data, can I follow the procedure without having to move the files?

Rsync copies the files over first, if you have a working backup you could try a move instead.

1 Like

@eneubauer I did migrate everything and so far it’s almost working perfectly.
In fact everything look ok but I decide to go see the log just in case.

I did notice that there is a lot of error relative to /raid10/tmp folder.
It’s obviously because of the migration, but I double check everything twice and I haven’t forget anything.

Any idea?

Regards,

I guess some part of your setup points to this tmp directory? Make sure it exists and has the correct permissions, that’s all I can tell you without having a full error message.

1 Like