a month ago
I have a WordPress site hosted on EC2 that I’d like to migrate to Railway. I plan to add the code to GitHub and deploy from there. However, I’m not sure how to migrate the existing media (about 15 GB) in that setup. I previously did a similar migration for Strapi, and the only workaround was to upload content via Filebrowser. What solution would you recommend? I’m potentially migrating 10+ apps, so I’d really appreciate a more straightforward, repeatable approach.
4 Replies
a month ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
a month ago
Is the media stored on the EC2 instance’s attached volume and served directly under wp-content/uploads ?
crisog
Is the media stored on the EC2 instance’s attached volume and served directly under wp-content/uploads ?
a month ago
Yes, that's correct
a month ago
The simplest and the most user friendly option is perhaps to deploy https://railway.com/deploy/Nan7Bs and temporarily detach the volume from your Wordpress service and attach it to the Filebrowser service, upload your data, and the attach the volume to the Wordpress service again. When deploying file browser make use to use USE_VOLUME_ROOT=1
It would be great if there would be an option in the railway CLI to do something like scp . For now since the ssh over WebSockets is the only way to get into the container you could still try the following trick (not too secure, but works):
On your existing EC2 instance archive the upload directory
cd wp-content && tar -zcvf ~/uploads.tar.gz uploadsto createuploads.tar.gzarchiveMove the archive you have just created into the uploads directory to make it publicly accessible via HTTP
mv uploads.tar.gz uploads/Test you can download it via browser
https://you-wordpress-site.com/wp-content/uploads/uploads.tar.gzSSH into your Railway service (use "Copy SSH command" item from right click menu on the service on the Railway dashboard)
Download your files using
wgeti.e.cd ~/thenwget https://you-wordpress-site.com/wp-content/uploads/uploads.tar.gz, this way you'll end up with the files archive in your homedir on the instanceMove the archive into Wordpress directory
mv ~/uploads.tar.gz /var/www/html/wp-content/and extract itcd /var/www/html/wp-content && tar -xvzf uploads.tar.gz
do not forget to delete the archive from your original EC2 uploads directory and the Railway service directory otherwise the archive would be accessible by anyone
Status changed to Solved brody • about 1 month ago