Move a very old version 10 to Docker

Hello!

I have a very old, but large (5TB) instance of seafile 10 that is running directly on ubuntu 20.04.

In order to upgrade this old version, I would like to move it to a docker container and then upgrade the OS and seafile one after each other.

However, I have run into some unclear issues with the migration to docker, despite having set proper file permissions before mounting the seafile_data folder into the seafile docker container.

I am wondering if it would be better to use backup and restore for moving to docker, so I can securely configure seafile in docker and then restore the files.

Of note, I do not have enough webspace to COPY the seafile_data folder, I can only MOVE it (or just change the mount point within docker).

Can I assume that the following approach is fine?

  1. Stop seafile bare metal and create a DB backup (rename the old databases as a second backup).

  2. install new seafile instance with new mariadb databases and make sure it works

  3. stop the docker container, restore the mariadb databases and move the seafile_data folder (or change mount point)

    WOuld this work? Is there any risk, seafile might corrupt my seafile_data folder or will it leave it unchanged unless i add new files or remove some in the webui?
    I remember that the docker instance would say β€œseafile_data” found so mysql-sh not executed?

Thanks,

Ruediger

Your proposed plan is sound and generally aligns with the official migration strategy. Since you have a large 5TB instance and cannot copy the data, moving the folder or adjusting the mount point is the correct approach.

Here are some specific technical details and recommendations to ensure a smooth migration:

1. Use the Same Seafile Version Initially

It is highly recommended to migrate to a Docker image that matches your current version (v10.0.x) first. Once the migration is confirmed successful and the service is running in Docker, you can then proceed with upgrading the Seafile version and the OS.

2. Expected Directory Structure

The Seafile Docker image expects a specific directory structure within your data volume. If your SEAFILE_VOLUME in the .env file is set to /opt/seafile-data, the structure should look like this:

/opt/seafile-data
└── seafile
    β”œβ”€β”€ ccnet
    β”œβ”€β”€ conf
    β”œβ”€β”€ seafile-data
    └── seahub-data

When you move your bare-metal data, ensure your existing conf, ccnet, seafile-data, and seahub-data folders are placed inside a seafile subdirectory within the mounted volume.

3. Update Configuration Files

After restoring the database and moving the files, you must update the configuration files in the conf/ directory. On bare-metal, these likely point to 127.0.0.1 or localhost. In Docker, they need to point to the database container host (usually db as defined in your docker-compose.yml or .env):

  • ccnet.conf: Update the HOST in [Database].
  • seafile.conf: Update the host in [database].
  • seahub_settings.py: Update the HOST in the DATABASES section.

4. Data Integrity and Initialization

  • Risk of Corruption: Seafile is designed to be robust. It generally treats the data blocks in seafile-data as immutable and only creates new blocks for changes. It will not corrupt your data during this move as long as the services are fully stopped during the migration.
  • Initialization Skip: You are correct; if the Docker container detects an existing seafile-data directory, it will skip the initial setup scripts and database table creation. This is exactly what you want for a migration.

5. File Permissions

Ensure that the files you move are accessible by the user running inside the container. By default, the container often runs as root.

For more detailed steps, you can refer to the official migration guide:
Migrate from non-docker Seafile deployment to docker

1 Like

THanks for the quick reply, I’ll give it another try!

P.S. Do I have to move and replace the seahub_data as well?

Yes, you should definitely move the seahub-data folder as well.

This folder contains data for the web front end (Seahub), such as user avatars and custom logos. Without it, these assets will be missing in your new installation.

As mentioned in the previous reply, for a Docker installation, the expected structure inside your mounted volume (e.g., /opt/seafile-data/seafile) includes:

  • conf
  • seafile-data
  • seahub-data

For more details on what needs to be backed up and moved, you can refer to the Backup and Recovery section of the manual.

Thank you so much @daniel.pan , everything worked great!
I am really relieved :slight_smile: Seafile rocks!

Regards,

Ruediger