Migrating an Instance
Introduction
There are several situations where ownCloud needs to be migrated.
The following scenarios are described here:
-
Migrating to a different host
-
Migrating to a different domain
-
Migrating from ownCloud Classic 10 to ownCloud Classic 11
Note that any database migration is not covered here.
| During the migration process, do not make any changes to the original system except to put it into maintenance mode. This ensures that, should anything unforeseen happen, you can revert to your existing installation and resume its availability while debugging the problem. |
You can find details of the steps for your ownCloud instance in the Manual ownCloud Upgrade documentation.
Special Migrations
Host Migration
Migration to a different host is easy with Docker.
-
Enable maintenance mode.
-
Prevent browser access via the proxy.
-
Down the container.
-
Make the data available on the new host:
-
Either copy the Docker volume if not using a shared mount point to the new host, or
-
Create a new shared mount point.
-
-
Copy / adapt the compose yaml file to reflect your changes.
-
Bring up the container.
-
Disable maintenance mode.
-
Reconfigure proxy access to the ownCloud Instance.
-
Reenable browser access via the proxy.
Domain Migration
As the ownCloud Classic 11 image provides an embedded Apache web server, you need a proxy to handle security and other web-related settings anyway. To migrate or add a domain, two steps are required:
-
Update your proxy server settings.
-
Update the ownCloud trusted domain settings.
Managing Trusted Domains
All URLs used to access your ownCloud server must be white-listed using an environment variable. Users are allowed to log into ownCloud only when they point their browsers to a URL that is listed in the OWNCLOUD_TRUSTED_DOMAINS setting.
| This setting is important when changing or moving to a new domain name. You may use IP addresses and domain names. |
The loopback address, 127.0.0.1, is automatically whitelisted. In the event that a load-balancer is in place, there will be no issues as long as it sends the correct X-Forwarded-Host header.
|
A typical configuration looks like this:
OWNCLOUD_TRUSTED_DOMAINS='server1.example.com','192.168.1.50'
ownCloud Classic Migration
|
|
With a few exceptions, ownCloud 11 provides nearly all configuration keys as environment variables. Therefore, it is highly recommended that any configuration keys are migrated to envvars, if possible. See the Important Configuration Notes documentation for more details. |
Docker to Docker
If you have previously used a Docker-based installation with ownCloud Classic 10, no data migration is required.
The main migration steps are the following:
-
Put your instance into maintenance mode.
-
Disable and then delete any app that is provided by ownCloud.
The deleted ownCloud apps were written in PHP 7.
The updated apps, which are now compliant with PHP 8, are embedded in the image. -
Prevent browser access via the proxy.
-
Down the compose environment.
-
Define the OC11 image that will be used with the container, then pull it.
-
Start the compose environment.
-
Turn Maintenance mode off.
-
Start the occ upgrade process.
-
Reenable browser access via the proxy.
Native to Docker
This section describes the migration of ownCloud Classic 10 to ownCloud Classic 11, if ownCloud Classic 10 was installed natively.
Due to the wide range of installation types, the description focuses on the main steps rather than the details. When using encryption with the ownCloud Classic 10 instance, the openSSL requirements must be met without circumventing retired ciphers. See the ownCloud Classic 10 encryption documentation for more details.
|
| This procedure assumes that the server hosting the native deployment of ownCloud Classic 10 is different from the server hosting ownCloud Classic 11. This is because the old server required a native PHP 7 environment. |
-
Prepare the server hosting ownCloud Classic 11.
-
Plan your deployment with regards to the database and the cache that will be used.
-
For details see the Installing with Docker documentation.
-
For more details see the Mount Folder Structure documentation.
-
Please note that starting the container with the default compose configuration will create an empty instance with a new database. This can be beneficial to see if the deployment works but needs to be adapted for the final setup. The generated data must be destroyed!
-
-
Enable maintenance mode on ownCloud Classic 10.
-
Disable any app that is enabled in ownCloud Classic 10.
The old ownCloud apps were written in PHP 7.
The updated ownCloud apps, which are now compliant with PHP 8, are embedded in the image. -
On the new server, create mount points to bind mount the required Docker volumes.
-
Migrate the data directory.
More details can be found in the Migrate the Datadirectory documentation. -
Adapt the
docker-compose.ymland the.envfile to your needs.-
Migrate any configurations formerly added to config.php to an environment variable.
-
Avoid redefining the
dataorappsdirectory based on your old config. Use the default settings the image provides. -
If any config setting has no environment variable, read the Important Configuration Notes documentation for more details.
-
-
Migrate all apps from ownCloud Classic 10 that are NOT part of ownCloud Classic 11 and PHP 8 compliant into the
<mount_point>/appsdirectory.
For more details see the Apps Management documentation. -
Bring up the ownCloud Classic 11 container.
-
Re-enable any available apps that were previously disabled.
-
Disable maintenance mode.
-
Enable user access via the proxy web server.