From my recent experience with migrating a legacy vB3 forum to Discourse, here are some tips:
Do It In Docker
Configuring Discourse in Docker is easy. However, what is really good is that if you have working Discourse site / application, you can build a Discourse Docker app easily anywhere on any server, and restore your backup in that new app, and you have your site back up again. Docker is great for web based applications. Consider using it.
Use Docker Shared Directories
In the Discourse app, there is a shared directory which is shared with the outside word (outside Docker) and it's located:
- Inside app: /shared
- Outside app: /shared/standalone
I think it is good to create your own directories in there, for example:
- /shared/neo/bin
- /shared/neo/dbdumps
The reason for this is that every time you rebuild your Discourse app using:
./launcher rebuild app
The Discourse / Docker Ruby bundler system will overwrite all files in the container which are not in the shared directory.
So, if you are editing your migration scripts, you will lose all changes when you rebuild the app in Docker.
In addition, when moving database dumps and image files inside the Docker container, it is easier to use the /shared
directory because you can remotely SFTP
right into it and place your DB dumps
and tarfiles
directly in the Docker container from a remote server.
** begin ... rescue ... end
is Your Friend **
In a big migration, especially with millions of files, there are bound to be some files which cause the migration to break. Trap these errors in Ruby
with begin ... rescue ... end
and add some puts
statements in your rescue
code and you will trap errors which will halt the migration. This is true both in your Ruby migration script and in the Discourse app Ruby libs.
Use Two Docker / Discourse Servers
Build in one Docker instance on server 1 and when you are happy, create a backup and restore that backup on server 2 (rinse and repeat). Doing this will help accelerate your learning time and you will also become very good at backup and recovery skills
Don't Strive for Perfection - the 98 to 99% Solution is OK
Yes, it would be great to migrate a legacy system and for every bit and byte to be perfect; however, do yourself a big favor and strive for 98 to 99% perfection. After all, the goal is not only to migrate your legacy posts; but to build for the future.
Stay tuned for Notes on vB3 to Discourse Migration: Part 2, coming soon.