Skip to content
Complete Source Code Export for Railway Functions
finn265
OP

an hour ago

Hello Railway team,

I need help recovering the complete source code of my existing Railway Function to establish a maintainable GitHub-based development workflow.

Current configuration

  • Railway Hobby plan
  • Railway Function using Bun 1.4.4
  • Production application currently running successfully
  • Persistent SQLite database on a Railway volume
  • Private GitHub repository available

The problem

Our application consists of a main TypeScript loader and numerous external JavaScript code fragments stored separately as service variables. These fragments are required to reconstruct and start the complete application.

We have already successfully retrieved and backed up the main Function source code. We also recovered approximately 407,000 characters of additional application code from an existing code-only backup.

However, several original source dependencies are still missing from our independent backup, including:

  • Additional JavaScript patches

Our connected Railway integration can retrieve the Function source and variable names, but variable values are redacted.

The previous automated support response suggested using railway functions link and railway functions pull. We have not tried these commands yet because we already have the main Function source file, and it remains unclear whether they include its external code dependencies.

Our questions

  1. Does railway functions pull retrieve only the main Function file, or does it also include separately stored code dependencies?
  2. Is there an officially supported way to recover a complete source-only application archive without exporting credentials or sensitive configuration?
  3. Is there a supported migration procedure for moving this architecture into a conventional GitHub repository?
  4. Can this be achieved on the Hobby plan without restarting or redeploying the production service?

Important requirements

  • No production downtime.
  • No database or customer data loss.
  • No exposure of API keys, passwords or credentials.
  • No changes to the existing production service.
  • No paid plan upgrade.

Our goal is to obtain a complete, independently runnable codebase that can be reviewed, tested and maintained through GitHub before future production deployments.

A concrete technical procedure or clarification of the available Railway capabilities would be greatly appreciated.

Thank you!

Under Review

0 Threads mention this feature

2 Replies

Railway
BOT

an hour ago

You can already pull a function's code locally with the CLI: link it with railway functions link --function <name> --path ./file.ts, then run railway functions pull to fetch its latest code, which you can then commit to a GitHub repository. See the railway functions CLI reference for the full command set.

Thanks for the suggestion of a one-click export.


Status changed to Awaiting User Response Railway • about 1 hour ago


Railway

You can already pull a function's code locally with the CLI: link it with `railway functions link --function <name> --path ./file.ts`, then run `railway functions pull` to fetch its latest code, which you can then commit to a GitHub repository. See the [railway functions CLI reference](https://docs.railway.com/cli/functions) for the full command set. Thanks for the suggestion of a one-click export.

finn265
OP

an hour ago

Thank you for your response!

We already successfully retrieved the main Function source file and backed it up to GitHub.

However, our application also depends on external JavaScript code fragments stored separately as service variables.

Does railway functions pull include these code dependencies, or does it only retrieve the main TypeScript file?

Is there an officially supported way to export the complete application source, including these code dependencies, while excluding credentials, API keys and other sensitive configuration?


Welcome!

Sign in to your Railway account to join the conversation.

Loading...