Data Exporter

Important Information

This app is currently in beta stage, the functionality is officially not supported.
Please file any issues here.
The app is not available on the marketplace.
To use this app, you must git clone it from the data_exporter repository and run make all in the apps root directory to install all dependencies.

Introduction

A set of occ command line tools to export and import users with their shares from one ownCloud instance in to another. Please see What is Exported for export details and Known Limitations for limitation details. Please see the Data Exporter Commands description for details using the occ commands.

To use data exporter, you must install and enable the data_exporter app on both, the source and the target instance first.

Use Cases

  • Manual zero-downtime migration of users and their shares from one instance in to another.

  • Migrate from instances with different storages (POSIX to S3).

  • Service GDPR-Requests by providing all files and metadata of a user in a single package.

  • Merge users from different instances.

Usage Example

Export user1 from a source instance to a target instance while preserving all shares with users on the source instance. For this example, both instances must be able to reach each other via federation.

Test if you can create remote shares before starting this process.

Export the User on the Source Instance

This will create a folder /tmp/export/user1 which contains all the files and metadata of the user.

sudo -u www-data ./occ instance:export:user user1 /tmp/export

Copy the Export to the Target Instance

Copy the created export to the target instance, for example, using scp:

scp -rp /tmp/export root@newinstance.com:/tmp/export

Import the User on the Target Instance

This imports the user in to the target instance while converting all their outgoing-shares to federated shares pointing to the source instance:

sudo -u www-data ./occ instance:import:user /tmp/export/user1
A new user’s last login timestamp on the target instance will be set to the current time. The import command sets up the user’s file system and the system does not need to do any further "first login" processing when the user first logs in to the target instance.

Recreate all Shares to Point to the Target Instance

user1 now lives on a target instance, therefore, it is necessary to recreate all shares so that they point to the target instance. To do so, run this command on the source instance:

sudo -u www-data ./occ instance:export:migrate:share user1 https://newinstance.com

Delete the User on the Source Instance

Finally delete user1 on the source instance:

This can not be undone!
If the user is stored in the ownCloud database, you need to manually reset their password on the target instance. See Known Limitations for further information.
sudo -u www-data ./occ user:delete user1

What is Exported

  • Files (Local)

  • Meta-data (Username, Email, Personal Settings)

  • Shares (Local, Link-shares, Group-Shares)

  • Versions

  • Trashbin

Known Limitations

  • External storages, comments and tags are not exported

  • If a user is stored in the ownCloud database (not-LDAP etc.) the password must be manually reset by the admin as passwords cannot be migrated.

  • Versions import in to S3 does not preserve the version timestamp.

  • Import alias (import using another username) currently does not work and breaks share-import.

  • Shares import requires federation to be correctly setup between both servers and share-api to be enabled.

  • A share’s state will always be "accepted" regardless of the state in the old server.

  • Remote shares from both directions need to be manually accepted.

  • Federated shares from other servers are not migrated.

  • Password protected link-shares are not imported correctly, user needs to reset the password.

  • Group shares require the group to be present on the target-system or else the share will be ignored silently.

  • If link-shares require a password on the new server but do not on the old, the import process will crash.

As this is an early version, some limitations might be fixed in the future while others cannot be circumvented.