5 months ago
i have a sqlite.db stored in /app/data volume - i need to copy it to my local machine. I am able to connect using SSH and do a ls
on the , but I would like to copy this file to my local machine. Since scp
is not possible, is there any other way?
Or can this be done from the railway.app site? I just want to bring the database to my local machine as a backup and as a test data on my localhost for dev testing
0 Replies
5 months ago
if you have somewhere to upload it to, curl --upload-file
is a possibility from ssh i suppose, and if you are able to install an ssh client in the container (depends on the image used) you can use that to send it to a target server in the opposite direction to normal
otherwise, changing the service to some other image thats more helpful such as the filebrowser template can help but will result in your app being unavailable while youre doing it
thank you Erisa for the response.
As of now, the repo is a plain repo with a requirements.txt which nixpacks picks up as a python project and I have not used any template - I am in the process of setting up a template for FastHTML so that it can have some intelligent defaults.
I just searched and found the file browsing template - gonna try it https://railway.com/template/Nan7Bs - please let me know if this is not the right template to use.
can you please give me some pointers to figure how to install ssh client in my container and to use curl. I am inexperienced with Linux, though not completely unfamiliar.
i thought that we could easily switch to the file browser template, but looks like i need to create a new project template and then copy the code over and deploy as a new project - if this is the case, then I would lose to the DB that is currently there as we have some real-life data for one key user who is an early-adopter. is there a way to deploy a filebrowser on an existing service?
5 months ago
Thanks Brody. We have already deployed File Browser in the same project. But the question is how do we set up USEVOLUMEROOT to point to the other service's /app/data folder? I am going through sharing variable reference to figure out, but if some help is given, it would be appreciated.
5 months ago
you cannot, you need to remove the volume from that service and attach it to the file browser
thanks Brody for the clarification. Then, i would be able to use the volume in the other service? does filebrowser expose any variables to make the volume available to other services within the same project?
5 months ago
nope, you cannot share the volume to multiple services at a time
thanks Brody. that means that we have come full circle and have not solved my issue - i need a way to enable browsing on my current project template, but if I use file-browser, I can't really do that - then why did @Erisa suggest that I use file browser template?
5 months ago
so that you would attach the volume with the sqlite file to the filebrowser service and download it
but then the sqlite is created/updated by the python program which runs as another service. we need file browser as a way to download that file created by the python FastHTML server
anyway, we are still new to railway and experimenting - hence good to learn these constraints about file browser.
when I used python-anywhere, i was able to upload/download files from a web-interface - those files would be used by the Django program then. is there a way to achieve something like that here?
and what is the procedure to take a backup of the data under a volume? sqlite is the default method recommended by FastHTML team - if there is no way to take a backup, then i would have to look at using postgres
i am new here - so, i am asking question to help me understand things - as I am trying to set up a proper template for FastHTML that would help us to overcome these initial hurdles - i intend to also publish it so that others can benefit from it.
5 months ago
you can use our native backups feature, or you can swap the volume to filebrowser, download the file, and then swap it back to the original service
oh ok. thanks - for now, i have set up a backup route through code and downloaded. but it felt cumbersome. so, I am going through the docs in detail to understand how best to deploy FastHTML as the defaults provided by the FastHTML team did not land us in a happy land.
5 months ago
!s
Status changed to Solved brody • 5 months ago