Migrate data between different backends

Seafile supports data migration between filesystem, s3, ceph, swift and Alibaba oss (migrating from swift is not supported yet, this support will be added in the future). If you enabled storage backend encryption feature, migration is not supported at the moment.

Data migration takes 3 steps:

  1. Create a new temporary seafile.conf
  2. Run migrate.sh
  3. Replace the original seafile.conf

Create a new temporary seafile.conf

We need to add new backend configurations to this file (including [block_backend], [commit_object_backend], [fs_object_backend] options) and save it under a readable path.
Let’s assume that we are migrating data to S3 and create temporary seafile.conf under /opt

  1. cat > seafile.conf << EOF
  2. [commit_object_backend]
  3. name = s3
  4. bucket = seacomm
  5. key_id = ******
  6. key = ******
  7. [fs_object_backend]
  8. name = s3
  9. bucket = seafs
  10. key_id = ******
  11. key = ******
  12. [block_backend]
  13. name = s3
  14. bucket = seablk
  15. key_id = ******
  16. key = ******
  17. EOF
  18. mv seafile.conf /opt

Repalce the configurations with your own choice.

Run migrate.sh

We assume you have installed seafile pro server under ~/haiwen, enter ~/haiwen/seafile-server-latest and run migrate.sh with parent path of temporary seafile.conf as parameter, here is /opt.

  1. cd ~/haiwen/seafile-server-latest
  2. ./migrate.sh /opt

Replace the original seafile.conf

After running the script, we need replace the original seafile.conf with new one:

  1. mv /opt/seafile.conf ~/haiwen/conf

now we only have configurations about backend, more config options, e.g. memcache and quota, please refer to this tutorial.

After replacing seafile.conf, you can restart seafile server and access the data on the new backend.