Migrating assets from old installation into docker

(Fernando Stefanini) #1

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:



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

I’ve found this post: Migrating 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:

1 Like
(Sam Saffron) #2

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.

1 Like
(Fernando Stefanini) #3

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.


(Fernando Stefanini) #4

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

Thanks again!

1 Like
(Sam Saffron) closed #5