How do you move/ transfer a simple self-hosted Coder setup to a new server?

I don't have a lot on my Coder server - a few templates (easy to transition) but mainly due to my ignorance of how Coder works under the hood and lack of familiarity with Terraform, I'm struggling to find how to move or if I can move my Coder server to a new server. Mainly concerned with my Workspace persistent storage I would prefer to transfer over the workspace instead of rebuilding the workspace. Still learning about how to set up the template correctly so that transfers are less of an issue. OS: Linux -> MacOS Workspace in question is a Docker container, started from the example template.
Solution:
the data is stored in ~/.config/coderv2
Jump to solution
10 Replies
Codercord
Codercord2mo ago
<#1333495609490931722>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Phorcys
Phorcys2mo ago
hey so for the Coder instance itself (settings, templates, etc), all you'd have to do is dump and restore the database for the persistent volumes, you'll have to export and re-import them hope this helps
asherwoo
asherwooOP2mo ago
Thanks, I ended up just looking into my docker image volume and pulling the files I needed. I didn't have much - just needed to pull files I hadn't put in github yet. Where could I find some documentation on the location of my Coder DB for self-hosted that I could export? To pull over the template I did it manually because I couldnt' find a way to export them only import them.
Phorcys
Phorcys2mo ago
are you using a postgres database or the built-in postgres db?
asherwoo
asherwooOP2mo ago
built in
Solution
Phorcys
Phorcys2mo ago
the data is stored in ~/.config/coderv2
Phorcys
Phorcys2mo ago
you can copy it over to your new server in your case it'll probably be /home/coder/.config/coderv2
Atif
Atif2mo ago
Also after you have moved please also consider moving to an external DB. https://coder.com/docs/admin/setup#migrating-from-the-built-in-database-to-an-external-database
Setup | Coder Docs
Configure user access to your control plane.
From An unknown user
From An unknown user
Phorcys
Phorcys2mo ago
@asherwoo I'm going to close this thread, feel free to reopen if needed
Codercord
Codercord2mo ago
@Phorcys closed the thread.

Did you find this page helpful?