Migrating assets from old installation into docker

AI-generated summary

The discussion revolves around migrating assets from an old Discourse installation to a Docker installation. stefanini.mf found that the Docker version has a complicated directory hierarchy, making it difficult to copy assets directly.

stefanini.mf was looking for a way to migrate assets without dumping the entire database, which is already being used by the Docker installation. sam suggested using the backup/restore option, but stefanini.mf was concerned about the overhead of backing up a large database.

sam then pointed out that the files are stored in the /uploads directory on the host, which is mounted inside the Docker container. stefanini.mf confirmed that this was the correct location and was able to successfully migrate the assets by moving the files through the /shared directory.

Hi there. :smiley:

I’m migrating a self-installed discourse to a docker install.
As my database is setup with amazon RDS, I found no complication in just setting up the docker version and pointing to the old-good database we were already using. However, as expected, all my assets like attachments and and profile pics are in the /public folder of the old installation.

My expectations were that I’d easily find a /public folder in the docker version and make a cp -r of my files there, but docker seems to create a slightly more complicated directory hierarchy with some hashes and stuff. eg:

/var/lib/docker/aufs/mnt/4d9d59bbbbaa4b4791b72b0b8c8421584f6baa7469dae92282e2cf5e93327c28/var/www/discourse/public

:disappointed:

and I now have a few /public folders with different hashes each.

I’ve found this post: Migrate an old Discourse install to Docker so far.

But checking what will be done by this, it looks like it’s gonna dump the whole database and some other stuff as well (which seems to me to be an overkill, as I’m using the same db and we have a rather big one running in production).

Does anyone know or can think of a nice way of doing this?
Or maybe a workaround for my cp -r plan

Thanks, beforehand. :wink:

Wait, why not simply use the backup/restore option?

The files are all there, but they are not in the container, see this line:

Search that area on the host.

Thanks for the reply :smiley:

If I understood it correctly, the backup/restore option would also include a dump of the whole database, right?
If that’s the case, I’d be backing up a rather big DB (2m posts and 300k users), then restoring it on itself (as both instances currently use the same RDS). That’s a overhead that I’d like to avoid if I could.

Oh. /uploads inside that directory seems to be exactly what I’m looking for. :smiley: As far as I understood these folders’ content will be mounted inside my docker, right? Then that should even work for logo and favicon images as well, I guess.

That’s really good! I’ll check if it works.

:smiley:

Just a follow up, moving the files through /shared worked like a charm :smile:

Thanks again!